From 304cb5d6556285df0ed49ef8693aaae77fcfee67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Sun, 14 Mar 2021 19:58:15 +0100 Subject: [PATCH] add CanLogin check for Authenticate. --- internal/session/auth.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/session/auth.go b/internal/session/auth.go index 5eb23bdb..e98c755f 100644 --- a/internal/session/auth.go +++ b/internal/session/auth.go @@ -19,6 +19,10 @@ func (manager *SessionManagerCtx) Authenticate(r *http.Request) (types.Session, return nil, fmt.Errorf("session not found") } + if !session.Profile().CanLogin { + return nil, fmt.Errorf("login disabled") + } + return session, nil }