mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
Add webauth as an auth type
When showing what auth type user uses to sign in, add a text for users with webauthn. On password change or sign in, throw not implemented error if user uses webauthn auth.
This commit is contained in:
@@ -41,9 +41,11 @@ def new_password(token):
|
||||
'id': user.id,
|
||||
'email': user.email_address,
|
||||
'password': form.new_password.data}
|
||||
if user.auth_type == 'email_auth':
|
||||
if user.email_auth:
|
||||
# they've just clicked an email link, so have done an email auth journey anyway. Just log them in.
|
||||
return log_in_user(user.id)
|
||||
elif user.webauthn_auth:
|
||||
raise NotImplementedError('webauthn not supported yet')
|
||||
else:
|
||||
# send user a 2fa sms code
|
||||
user.send_verify_code()
|
||||
|
||||
@@ -49,6 +49,8 @@ def sign_in():
|
||||
return redirect(url_for('.two_factor', next=redirect_url))
|
||||
if user.email_auth:
|
||||
return redirect(url_for('.two_factor_email_sent', next=redirect_url))
|
||||
if user.webauthn_auth:
|
||||
raise NotImplementedError('webauthn not supported yet')
|
||||
|
||||
# Vague error message for login in case of user not known, locked, inactive or password not verified
|
||||
flash(Markup(
|
||||
|
||||
Reference in New Issue
Block a user