Skip to content

Commit

Permalink
fix:redirect host not match domain
Browse files Browse the repository at this point in the history
  • Loading branch information
fangguangyang committed Aug 31, 2023
1 parent d972a18 commit 0e5372e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func ValidateRedirect(r *http.Request, redirect string) (*url.URL, error) {
if use, base := useAuthDomain(r); use {
// If we are using an auth domain, they redirect must share a common
// suffix with the requested redirect
if !strings.HasSuffix(redirectURL.Host, base) {
if !strings.HasSuffix(strings.Split(redirectURL.Host, ":")[0], base) {
return nil, errors.New("Redirect host does not match any expected hosts (should match cookie domain when using auth host)")
}
} else {
Expand Down

0 comments on commit 0e5372e

Please sign in to comment.