add CanLogin check for Authenticate.

This commit is contained in:
Miroslav Šedivý 2021-03-14 19:58:15 +01:00
parent 9483882c89
commit 304cb5d655

View File

@ -19,6 +19,10 @@ func (manager *SessionManagerCtx) Authenticate(r *http.Request) (types.Session,
return nil, fmt.Errorf("session not found") return nil, fmt.Errorf("session not found")
} }
if !session.Profile().CanLogin {
return nil, fmt.Errorf("login disabled")
}
return session, nil return session, nil
} }