This commit is contained in:
Yvan
2026-01-06 12:20:42 +08:00
commit 253275b280
219 changed files with 23633 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
package auth
import (
"os"
"time"
)
// authSecretFromEnv retrieves the authentication secret from the environment variable.
func authSecretFromEnv(key string) string {
if secret := os.Getenv(key); secret != "" {
return secret
}
return time.Now().Format("20060102150405")
}
// cookieNameFromEnv retrieves the cookie name from the environment variable.
func cookieNameFromEnv(key string) string {
if name := os.Getenv(key); name != "" {
return name
}
return "access_token"
}