fix(handler/default): only assert loginstatus if we already have an active session

This commit is contained in:
Trong Huu Nguyen
2022-07-20 15:56:23 +02:00
parent 242dc12be9
commit 595d902dcd
+5 -5
View File
@@ -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) {