forked from Nixius/authelia
Fall back to LDAP group check when Authelia session is stale
The Remote-Groups header reflects groups at login time. If a user was added to 'customers' after logging in (via /activate), the dashboard would show "No Active Subscription". Now checks LDAP directly as fallback. Made-with: Cursor
This commit is contained in:
parent
1f8f50d50b
commit
bbc828fa35
|
|
@ -15,6 +15,14 @@ func (a *App) handleDashboard(w http.ResponseWriter, r *http.Request) {
|
|||
remoteGroups := r.Header.Get("Remote-Groups")
|
||||
isSubscribed := remoteGroups != "" && contains(remoteGroups, "customers")
|
||||
|
||||
// Authelia session may be stale (user was added to customers after login).
|
||||
if !isSubscribed && remoteUser != "" {
|
||||
inGroup, _ := a.ldap.IsInGroup(remoteUser, "customers")
|
||||
if inGroup {
|
||||
isSubscribed = true
|
||||
}
|
||||
}
|
||||
|
||||
var customerID string
|
||||
stackDeployed := false
|
||||
stackRunning := false
|
||||
|
|
|
|||
Loading…
Reference in New Issue