mirror of
https://github.com/lukaszraczylo/traefikoidc.git
synced 2026-06-05 22:44:17 +00:00
Fix the bug with user not being redirected to originally requested URL post authentication.
This commit is contained in:
+8
-1
@@ -226,7 +226,14 @@ func (t *TraefikOidc) handleCallback(rw http.ResponseWriter, req *http.Request)
|
||||
}
|
||||
|
||||
t.logger.Debugf("Authentication successful. User email: %s", email)
|
||||
http.Redirect(rw, req, "/", http.StatusFound)
|
||||
http.Redirect(rw, req, func() string {
|
||||
if path, ok := session.Values["incoming_path"].(string); ok {
|
||||
t.logger.Debug("Redirecting to incoming path from original request: %s", path)
|
||||
return path
|
||||
}
|
||||
t.logger.Debug("Redirecting to root path as no incoming path found")
|
||||
return "/"
|
||||
}(), http.StatusFound)
|
||||
}
|
||||
|
||||
func extractClaims(tokenString string) (map[string]interface{}, error) {
|
||||
|
||||
Reference in New Issue
Block a user