No need to store remember_token in DB

This commit is contained in:
Matt Wright
2012-08-14 13:52:30 -04:00
parent f6bb01545d
commit 58e2856612
5 changed files with 34 additions and 35 deletions
-9
View File
@@ -44,9 +44,6 @@ def login_user(user, remember=True):
if user.authentication_token is None:
user.authentication_token = generate_authentication_token(user)
if remember:
user.remember_token = get_remember_token(user.email, user.password)
if _security.trackable:
old_current, new_current = user.current_login_at, datetime.utcnow()
user.last_login_at = old_current or new_current
@@ -110,12 +107,6 @@ def generate_token():
return base64.urlsafe_b64encode(os.urandom(30))
def get_remember_token(email, password):
assert email is not None
assert password is not None
return make_secure_token(email, password)
def do_flash(message, category=None):
"""Flash a message depending on if the `FLASH_MESSAGES` configuration
value is set.