mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-25 10:18:59 +02:00
fix(oidc): correct behavior when working with bypass rules
- Introduced a new handler for unknown paths in the OIDCProvider to prevent fallback to the default login page. - Forced OIDC middleware to treat unknown path as logic path to redirect to login property when bypass rules is declared. - Refactored OIDC path constants. - Updated checkBypass middleware to enforce path prefixes for bypass rules, ensuring proper request handling.
This commit is contained in:
@@ -74,6 +74,11 @@ func (amw *oidcMiddleware) initSlow() error {
|
||||
}
|
||||
// If no custom credentials, authProvider remains the global one
|
||||
|
||||
// Always trigger login on unknown paths.
|
||||
// This prevents falling back to the default login page, which applies bypass rules.
|
||||
// Without this, redirecting to the global login page could circumvent the intended route restrictions.
|
||||
authProvider.SetOnUnknownPathHandler(authProvider.LoginHandler)
|
||||
|
||||
// Apply per-route user/group restrictions (these always override global)
|
||||
if len(amw.AllowedUsers) > 0 {
|
||||
authProvider.SetAllowedUsers(amw.AllowedUsers)
|
||||
|
||||
Reference in New Issue
Block a user