108536490: Implement LoginManager for the admin app.

Also added csrf error handler, will make the session unauthorized if the csrf token is invalid.
This commit is contained in:
Rebecca Law
2015-11-30 11:21:51 +00:00
parent 48b7a7dc37
commit 6f61906fd4
6 changed files with 87 additions and 59 deletions

View File

@@ -1,7 +1,7 @@
from datetime import datetime
from app.main.dao import users_dao
from app.models import Users
from app.models import User
def test_render_sign_in_returns_sign_in_template(notifications_admin):
@@ -14,12 +14,12 @@ def test_render_sign_in_returns_sign_in_template(notifications_admin):
def test_process_sign_in_return_2fa_template(notifications_admin, notifications_admin_db):
user = Users(email_address='valid@example.gov.uk',
password='val1dPassw0rd!',
mobile_number='+441234123123',
name='valid',
created_at=datetime.now(),
role_id=1)
user = User(email_address='valid@example.gov.uk',
password='val1dPassw0rd!',
mobile_number='+441234123123',
name='valid',
created_at=datetime.now(),
role_id=1)
users_dao.insert_user(user)
response = notifications_admin.test_client().post('/sign-in',
data={'email_address': 'valid@example.gov.uk',