mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-10-28 12:45:47 +00:00
fix(redirect): allow root cookie domain host redirects (#409)
Previously IsRedirectSafe rejected redirects to the exact cookie domain when AppURL had multiple subdomain levels, because it stripped the first label twice.
This commit is contained in:
@@ -100,17 +100,17 @@ func IsRedirectSafe(redirectURL string, domain string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
cookieDomain, err := GetCookieDomain(redirectURL)
|
||||
host := parsedURL.Hostname()
|
||||
if host == domain {
|
||||
return true
|
||||
}
|
||||
|
||||
cookieDomain, err := GetCookieDomain(redirectURL)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
if cookieDomain != domain {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
return cookieDomain == domain
|
||||
}
|
||||
|
||||
func GetLogLevel(level string) zerolog.Level {
|
||||
|
||||
Reference in New Issue
Block a user