mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 08:31:00 -04:00
Remember me functionality added and tested.
Merge extra. Fixed comment.
This commit is contained in:
committed by
Adam Shimali
parent
bcf21f5ab2
commit
c959678c49
@@ -1,7 +1,7 @@
|
||||
from notifications_python_client.notifications import BaseAPIClient
|
||||
from notifications_python_client.errors import HTTPError
|
||||
|
||||
from flask.ext.login import UserMixin
|
||||
from flask.ext.login import (UserMixin, login_fresh)
|
||||
|
||||
|
||||
class UserApiClient(BaseAPIClient):
|
||||
@@ -100,6 +100,12 @@ class User(UserMixin):
|
||||
def is_active(self):
|
||||
return self.state == 'active'
|
||||
|
||||
def is_authenticated(self):
|
||||
# To handle remember me token renewal
|
||||
if not login_fresh():
|
||||
return False
|
||||
return super(User, self).is_authenticated()
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
return self._id
|
||||
|
||||
Reference in New Issue
Block a user