add env files
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing

This commit is contained in:
aovantsev
2025-10-03 13:33:22 +03:00
parent 324e861218
commit d0f14dfca2
22 changed files with 468 additions and 41 deletions

View File

@@ -17,7 +17,7 @@ import (
var jwtSecret []byte
// InitJWT initializes JWT secret
// InitJWT initializes JWT secret (legacy function)
func InitJWT() {
secret := os.Getenv("JWT_SECRET")
if secret == "" {
@@ -28,6 +28,11 @@ func InitJWT() {
jwtSecret = []byte(secret)
}
// InitJWTWithConfig initializes JWT secret with configuration
func InitJWTWithConfig(config *Config) {
jwtSecret = []byte(config.JWTSecret)
}
// generateRandomSecret generates a random secret for JWT
func generateRandomSecret() string {
b := make([]byte, 32)