mirror of
https://github.com/wassname/flask-security.git
synced 2026-08-16 11:20:58 +08:00
No need to store remember_token in DB
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user