mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 05:29:38 -04:00
Merge pull request #3371 from alphagov/flask-login-again
Flask login (but backwards compatible)
This commit is contained in:
@@ -531,6 +531,12 @@ def make_session_permanent():
|
||||
when you first log in/sign up/get invited/etc, but we do it just to be safe. For more reading, check here:
|
||||
https://stackoverflow.com/questions/34118093/flask-permanent-session-where-to-define-them
|
||||
"""
|
||||
|
||||
# TODO: Remove this loop after a weekend, when all cookies have either run through this code or expired
|
||||
for val in ['user_id', 'remember', 'remember_seconds']:
|
||||
if val in session:
|
||||
session[f'_{val}'] = session[val]
|
||||
|
||||
session.permanent = True
|
||||
|
||||
|
||||
|
||||
@@ -139,6 +139,7 @@ class User(JSONModel, UserMixin):
|
||||
|
||||
def login(self):
|
||||
login_user(self)
|
||||
session['user_id'] = self.id
|
||||
|
||||
def sign_in(self):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user