mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 14:09:20 -04:00
Merge pull request #3926 from alphagov/sign-in-bug
ensure user details are always in the session after entering password
This commit is contained in:
@@ -142,20 +142,12 @@ class User(JSONModel, UserMixin):
|
||||
login_user(self)
|
||||
session['user_id'] = self.id
|
||||
|
||||
def sign_in(self):
|
||||
|
||||
session['user_details'] = {"email": self.email_address, "id": self.id}
|
||||
|
||||
if not self.is_active:
|
||||
return False
|
||||
|
||||
def send_login_code(self):
|
||||
if self.email_auth:
|
||||
user_api_client.send_verify_code(self.id, 'email', None, request.args.get('next'))
|
||||
if self.sms_auth:
|
||||
user_api_client.send_verify_code(self.id, 'sms', self.mobile_number)
|
||||
|
||||
return True
|
||||
|
||||
def sign_out(self):
|
||||
session.clear()
|
||||
# Update the db so the server also knows the user is logged out.
|
||||
|
||||
Reference in New Issue
Block a user