forked from Nixius/authelia
1
0
Fork 0

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:
Leopere 2026-03-03 18:11:31 -05:00
parent 1f8f50d50b
commit bbc828fa35
Signed by: colin
SSH Key Fingerprint: SHA256:nRPCQTeMFLdGytxRQmPVK9VXY3/ePKQ5lGRyJhT5DY8
1 changed files with 8 additions and 0 deletions

View File

@ -15,6 +15,14 @@ func (a *App) handleDashboard(w http.ResponseWriter, r *http.Request) {
remoteGroups := r.Header.Get("Remote-Groups") remoteGroups := r.Header.Get("Remote-Groups")
isSubscribed := remoteGroups != "" && contains(remoteGroups, "customers") 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 var customerID string
stackDeployed := false stackDeployed := false
stackRunning := false stackRunning := false