diff --git a/kallithea/lib/auth.py b/kallithea/lib/auth.py --- a/kallithea/lib/auth.py +++ b/kallithea/lib/auth.py @@ -626,10 +626,6 @@ class AuthUser(object): return ""\ % (self.user_id, self.username, self.is_authenticated) - def set_authenticated(self, authenticated=True): - if not self.is_default_user: - self.is_authenticated = authenticated - def to_cookie(self): """ Serializes this login session to a cookie `dict`. """ return { @@ -650,7 +646,8 @@ class AuthUser(object): ) if not au.is_authenticated and au.user_id is not None: # user is not authenticated and not empty - au.set_authenticated(cookie.get('is_authenticated')) + if not au.is_default_user: + au.is_authenticated = cookie.get('is_authenticated') return au @classmethod diff --git a/kallithea/lib/base.py b/kallithea/lib/base.py --- a/kallithea/lib/base.py +++ b/kallithea/lib/base.py @@ -116,7 +116,8 @@ def log_in_user(user, remember, is_exter auth_user = AuthUser(dbuser=user, is_external_auth=is_external_auth) - auth_user.set_authenticated() + if not auth_user.is_default_user: + auth_user.is_authenticated = True # Start new session to prevent session fixation attacks. session.invalidate()