Add webauthn as an auth type.

Both in our models and as a migration to add it to auth_types
table.

Make sure that if we downgrade, we first clean up the data.
This commit is contained in:
Pea Tyczynska
2021-05-12 15:58:13 +01:00
parent ef3d6aded4
commit 098c6f031b
3 changed files with 45 additions and 4 deletions

View File

@@ -75,9 +75,9 @@ def handle_integrity_error(exc):
"""
Handle integrity errors caused by the auth type/mobile number check constraint
"""
if 'ck_users_mobile_or_email_auth' in str(exc):
if 'ck_user_has_mobile_or_other_auth' in str(exc):
# we don't expect this to trip, so still log error
current_app.logger.exception('Check constraint ck_users_mobile_or_email_auth triggered')
current_app.logger.exception('Check constraint ck_user_has_mobile_or_other_auth triggered')
return jsonify(result='error', message='Mobile number must be set if auth_type is set to sms_auth'), 400
raise exc