mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-11 10:28:41 -04:00
Set user to sign in with newly-added key
This commit is contained in:
@@ -53,6 +53,7 @@ def webauthn_complete_register():
|
|||||||
return cbor.encode(str(e)), 400
|
return cbor.encode(str(e)), 400
|
||||||
|
|
||||||
current_user.create_webauthn_credential(credential)
|
current_user.create_webauthn_credential(credential)
|
||||||
|
current_user.update(auth_type='webauthn_auth')
|
||||||
|
|
||||||
flash((
|
flash((
|
||||||
'Registration complete. Next time you sign in to Notify '
|
'Registration complete. Next time you sign in to Notify '
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ def test_begin_register_stores_state_in_session(
|
|||||||
def test_complete_register_creates_credential(
|
def test_complete_register_creates_credential(
|
||||||
platform_admin_user,
|
platform_admin_user,
|
||||||
platform_admin_client,
|
platform_admin_client,
|
||||||
|
mock_update_user_attribute,
|
||||||
mocker,
|
mocker,
|
||||||
):
|
):
|
||||||
with platform_admin_client.session_transaction() as session:
|
with platform_admin_client.session_transaction() as session:
|
||||||
@@ -134,6 +135,10 @@ def test_complete_register_creates_credential(
|
|||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
credential_mock.assert_called_once_with('state', 'public_key_credential')
|
credential_mock.assert_called_once_with('state', 'public_key_credential')
|
||||||
user_api_mock.assert_called_once_with(platform_admin_user['id'], 'cred')
|
user_api_mock.assert_called_once_with(platform_admin_user['id'], 'cred')
|
||||||
|
mock_update_user_attribute.assert_called_once_with(
|
||||||
|
platform_admin_user['id'],
|
||||||
|
auth_type='webauthn_auth',
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_complete_register_clears_session(
|
def test_complete_register_clears_session(
|
||||||
|
|||||||
Reference in New Issue
Block a user