Remember me functionality added and tested.

Merge extra.

Fixed comment.
This commit is contained in:
Nicholas Staples
2016-02-23 15:45:19 +00:00
committed by Adam Shimali
parent bcf21f5ab2
commit c959678c49
11 changed files with 118 additions and 15 deletions

View File

@@ -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