mirror of
https://github.com/nais/wonderwall.git
synced 2026-08-23 21:16:14 +00:00
fix(handler/default): only assert loginstatus if we already have an active session
This commit is contained in:
@@ -19,12 +19,12 @@ func (h *Handler) Default(w http.ResponseWriter, r *http.Request) {
|
||||
if hasAccessToken {
|
||||
// add authentication if session cookie and token checks out
|
||||
isAuthenticated = true
|
||||
}
|
||||
|
||||
// force new authentication if loginstatus is enabled and cookie isn't set
|
||||
if h.Loginstatus.NeedsLogin(r) {
|
||||
isAuthenticated = false
|
||||
logentry.LogEntry(r).Info("default: loginstatus was enabled, but no matching cookie was found; state is now unauthenticated")
|
||||
// force new authentication if loginstatus is enabled and cookie isn't set
|
||||
if h.Loginstatus.NeedsLogin(r) {
|
||||
isAuthenticated = false
|
||||
logentry.LogEntry(r).Info("default: loginstatus was enabled, but no matching cookie was found; state is now unauthenticated")
|
||||
}
|
||||
}
|
||||
|
||||
if h.AutoLogin.NeedsLogin(r, isAuthenticated) {
|
||||
|
||||
Reference in New Issue
Block a user