mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
Remove webauthn hooks
This changeset removes webauthn from the Notify.gov admin app. We are not using webauthn at all in our implementation and will be looking at an entirely different authentication system in the near future. Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
{% macro webauthn_api_check() %}
|
||||
<script>
|
||||
if ('credentials' in window.navigator) {
|
||||
document.body.className = ((document.body.className) ? document.body.className + ' webauthn-api-enabled' : 'webauthn-api-enabled');
|
||||
}
|
||||
</script>
|
||||
{% endmacro %}
|
||||
@@ -49,11 +49,9 @@
|
||||
|
||||
<h2 class="font-body-lg">Authentication</h2>
|
||||
<p>{{ user.auth_type | format_auth_type }}</p>
|
||||
{% if user.auth_type != 'webauthn_auth' %}
|
||||
<a class="govuk-link govuk-link" href="{{ url_for('main.change_user_auth', user_id=user.id) }}">
|
||||
Change authentication for this user
|
||||
</a>
|
||||
{% endif %}
|
||||
<a class="govuk-link govuk-link" href="{{ url_for('main.change_user_auth', user_id=user.id) }}">
|
||||
Change authentication for this user
|
||||
</a>
|
||||
|
||||
<h2 class="font-body-lg">Last login</h2>
|
||||
{% if not user.logged_in_at %}
|
||||
|
||||
@@ -11,11 +11,7 @@
|
||||
{% endif %}
|
||||
|
||||
{% if service_has_email_auth %}
|
||||
{% if user.webauthn_auth %}
|
||||
<p class="bottom-gutter govuk-body">
|
||||
This user will login with a security key.
|
||||
</p>
|
||||
{% elif not mobile_number %}
|
||||
{% if not mobile_number %}
|
||||
{{ radios(
|
||||
form.login_authentication,
|
||||
disable=['sms_auth'],
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
{% extends "withoutnav_template.html" %}
|
||||
{% from "components/page-header.html" import page_header %}
|
||||
{% from "components/uk_components/button/macro.njk" import govukButton %}
|
||||
{% from "components/uk_components/back-link/macro.njk" import govukBackLink %}
|
||||
{% from "components/webauthn-api-check.html" import webauthn_api_check %}
|
||||
{% from "components/uk_components/error-message/macro.njk" import govukErrorMessage %}
|
||||
|
||||
{% set page_title = 'Get your security key' %}
|
||||
|
||||
{% block extra_javascripts_before_body %}
|
||||
{{ webauthn_api_check() }}
|
||||
{% endblock %}
|
||||
|
||||
{% block per_page_title %}
|
||||
{{ page_title }}
|
||||
{% endblock %}
|
||||
|
||||
{% block backLink %}
|
||||
{{ govukBackLink({ "href": url_for('.user_profile') }) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
{{ govukErrorMessage({
|
||||
"classes": "banner-dangerous govuk-!-display-none",
|
||||
"html": (
|
||||
'There’s a problem with your security key' +
|
||||
'<p>Check you have the right key and try again. ' +
|
||||
'If this does not work, ' +
|
||||
'<a class="govuk-link govuk-link--no-visited-state" href=' + url_for('main.support') + ">contact us</a>." +
|
||||
'</p>'
|
||||
),
|
||||
"attributes": {
|
||||
"aria-live": "polite",
|
||||
"tabindex": '-1'
|
||||
}
|
||||
}) }}
|
||||
|
||||
<div class="govuk-grid-row">
|
||||
<div class="govuk-grid-column-one-half">
|
||||
{{ page_header(page_title) }}
|
||||
|
||||
<p>
|
||||
You need to have your security key to sign in.
|
||||
</p>
|
||||
|
||||
{{ govukButton({
|
||||
"element": "button",
|
||||
"text": "Check security key",
|
||||
"classes": "govuk-button--secondary webauthn__api-required",
|
||||
"attributes": {
|
||||
"data-module": "authenticate-security-key",
|
||||
"data-csrf-token": csrf_token(),
|
||||
}
|
||||
}) }}
|
||||
|
||||
{{ govukErrorMessage({
|
||||
"classes": "webauthn__api-missing",
|
||||
"text": "Your browser does not support security keys. Try signing in to Notify using a different browser."
|
||||
}) }}
|
||||
|
||||
{{ govukErrorMessage({
|
||||
"classes": "webauthn__no-js",
|
||||
"text": "JavaScript is not available for this page. Security keys need JavaScript to work."
|
||||
}) }}
|
||||
</div>
|
||||
<div class="govuk-grid-column-one-quarter">
|
||||
<img src="{{ asset_url('images/security-key.svg') }}" alt="" class="webauthn-illustration" width="149" height="150">
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -65,22 +65,6 @@
|
||||
}}
|
||||
{% endcall %}
|
||||
|
||||
{% if current_user.can_use_webauthn %}
|
||||
{% call row(id='security-keys') %}
|
||||
{{ text_field('Security keys') }}
|
||||
{{ optional_text_field(
|
||||
('{} registered'.format(current_user.webauthn_credentials|length)) if current_user.webauthn_credentials else None,
|
||||
default='None registered'
|
||||
) }}
|
||||
{{ edit_field(
|
||||
'Change',
|
||||
url_for('.user_profile_security_keys'),
|
||||
suffix='security keys'
|
||||
)
|
||||
}}
|
||||
{% endcall %}
|
||||
{% endif %}
|
||||
|
||||
{% if current_user.platform_admin or session.get('disable_platform_admin_view') %}
|
||||
{% call row(id='disable-platform-admin') %}
|
||||
{{ text_field('Use platform admin view') }}
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
{% extends "withoutnav_template.html" %}
|
||||
{% from "components/page-header.html" import page_header %}
|
||||
{% from "components/page-footer.html" import page_footer %}
|
||||
{% from "components/form.html" import form_wrapper %}
|
||||
{% from "components/uk_components/back-link/macro.njk" import govukBackLink %}
|
||||
|
||||
{% set page_title = 'Manage ' + '‘' + security_key.name + '’' %}
|
||||
|
||||
{% block per_page_title %}
|
||||
{{ page_title }}
|
||||
{% endblock %}
|
||||
|
||||
{% block backLink %}
|
||||
{{ govukBackLink({ "href": url_for('.user_profile_security_keys') }) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
{{ page_header(page_title) }}
|
||||
|
||||
<div class="govuk-grid-row">
|
||||
<div class="govuk-grid-column-three-quarters">
|
||||
{% call form_wrapper(autocomplete=True) %}
|
||||
{{ form.security_key_name }}
|
||||
{{ page_footer(
|
||||
'Save',
|
||||
delete_link=url_for(
|
||||
'.user_profile_confirm_delete_security_key', key_id=security_key.id),
|
||||
delete_link_text='Delete'
|
||||
) }}
|
||||
{% endcall %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -1,107 +0,0 @@
|
||||
{% extends "withoutnav_template.html" %}
|
||||
{% from "components/page-header.html" import page_header %}
|
||||
{% from "components/uk_components/button/macro.njk" import govukButton %}
|
||||
{% from "components/uk_components/back-link/macro.njk" import govukBackLink %}
|
||||
{% from "components/table.html" import edit_field, mapping_table, row, field, row_heading %}
|
||||
{% from "components/webauthn-api-check.html" import webauthn_api_check %}
|
||||
{% from "components/uk_components/error-message/macro.njk" import govukErrorMessage %}
|
||||
|
||||
{% set page_title = 'Security keys' %}
|
||||
{% set credentials = current_user.webauthn_credentials %}
|
||||
|
||||
{% block extra_javascripts_before_body %}
|
||||
{{ webauthn_api_check() }}
|
||||
{% endblock %}
|
||||
|
||||
{% block per_page_title %}
|
||||
{{ page_title }}
|
||||
{% endblock %}
|
||||
|
||||
{% block backLink %}
|
||||
{{ govukBackLink({ "href": url_for('.user_profile') }) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
{% set webauthn_button %}
|
||||
{{ govukButton({
|
||||
"element": "button",
|
||||
"text": "Register a key",
|
||||
"classes": "govuk-button--secondary webauthn__api-required",
|
||||
"attributes": {
|
||||
"data-module": "register-security-key",
|
||||
"data-csrf-token": csrf_token(),
|
||||
}
|
||||
}) }}
|
||||
|
||||
{{ govukErrorMessage({
|
||||
"classes": "webauthn__api-missing",
|
||||
"text": "Your browser does not support security keys. Try signing in to Notify using a different browser."
|
||||
}) }}
|
||||
|
||||
{{ govukErrorMessage({
|
||||
"classes": "webauthn__no-js",
|
||||
"text": "JavaScript is not available for this page. Security keys need JavaScript to work."
|
||||
}) }}
|
||||
{% endset %}
|
||||
|
||||
<div class="govuk-grid-row">
|
||||
|
||||
{{ govukErrorMessage({
|
||||
"classes": "banner-dangerous govuk-!-display-none",
|
||||
"html": (
|
||||
'There’s a problem with your security key' +
|
||||
'<p>Check you have the right key and try again. ' +
|
||||
'If this does not work, ' +
|
||||
'<a class="govuk-link govuk-link--no-visited-state" href=' + url_for('main.support') + ">contact us</a>." +
|
||||
'</p>'
|
||||
),
|
||||
"attributes": {
|
||||
"aria-live": "polite",
|
||||
"tabindex": '-1'
|
||||
}
|
||||
}) }}
|
||||
|
||||
{% if credentials %}
|
||||
<div class="govuk-grid-column-five-sixths">
|
||||
{{ page_header(page_title) }}
|
||||
<div class="body-copy-table">
|
||||
{% call mapping_table(
|
||||
caption=page_title,
|
||||
field_headings=['Security key details', 'Action'],
|
||||
field_headings_visible=False,
|
||||
caption_visible=False,
|
||||
) %}
|
||||
{% for credential in credentials %}
|
||||
{% call row() %}
|
||||
{% call field() %}
|
||||
<div class="govuk-body">{{ credential.name }}</div>
|
||||
<div class="govuk-body hint">Registered {{ credential.created_at|format_delta }}</div>
|
||||
{% endcall %}
|
||||
{{ edit_field('Manage', url_for('.user_profile_manage_security_key', key_id=credential.id)) }}
|
||||
{% endcall %}
|
||||
{% endfor %}
|
||||
{% endcall %}
|
||||
</div>
|
||||
{{ webauthn_button }}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="govuk-grid-column-one-half">
|
||||
{{ page_header(page_title) }}
|
||||
<p>
|
||||
Security keys are an alternative way of signing in to Notify,
|
||||
instead of getting a code in a text message
|
||||
</p>
|
||||
<p>
|
||||
You can buy any key that’s compatible with the WebAuthn
|
||||
standard.
|
||||
</p>
|
||||
{{ webauthn_button }}
|
||||
</div>
|
||||
<div class="govuk-grid-column-one-quarter">
|
||||
<img src="{{ asset_url('images/security-key.svg') }}" alt="" class="webauthn-illustration" width="149" height="150">
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user