Files
Authentication/handlers/redirect.go
T
2026-01-07 13:20:24 +08:00

22 lines
421 B
Go

package handlers
import (
"os"
"strings"
)
func IsAllowedRedirectURI(uri string) bool {
allowedRedirectURIsEnv := os.Getenv("ALLOWED_REDIRECT_URIS")
if allowedRedirectURIsEnv == "" {
return false
}
allowedRedirectURIs := strings.Split(allowedRedirectURIsEnv, ",")
for _, allowed := range allowedRedirectURIs {
if uri == strings.TrimSpace(allowed) { // Exact match only
return true
}
}
return false
}