Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4ed2cecec5 |
@@ -211,6 +211,14 @@ func (u *UIServer) finishLogin(w http.ResponseWriter, r *http.Request, acct *mod
|
||||
// SSO redirect flow: issue authorization code and redirect to service.
|
||||
if ssoNonce != "" {
|
||||
if callbackURL, ok := u.buildSSOCallback(r, ssoNonce, acct.ID); ok {
|
||||
// Security: htmx follows 302 redirects via fetch, which fails
|
||||
// cross-origin (no CORS on the service callback). Use HX-Redirect
|
||||
// so htmx performs a full page navigation instead.
|
||||
if isHTMX(r) {
|
||||
w.Header().Set("HX-Redirect", callbackURL)
|
||||
w.WriteHeader(http.StatusOK)
|
||||
return
|
||||
}
|
||||
http.Redirect(w, r, callbackURL, http.StatusFound)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user