diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 01:45:44 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 01:45:44 +0000 |
commit | 85dc423f7090da0a52c73eb66faf22ddb20efff9 (patch) | |
tree | 9160f299afd8c80c038f08e1545be119f5e3f1e1 /app/views/authentication | |
parent | 15c2c8c66dbe422588e5411eee7e68f1fa440bb8 (diff) | |
download | gitlab-ce-85dc423f7090da0a52c73eb66faf22ddb20efff9.tar.gz |
Add latest changes from gitlab-org/gitlab@13-4-stable-ee
Diffstat (limited to 'app/views/authentication')
-rw-r--r-- | app/views/authentication/_authenticate.html.haml | 19 | ||||
-rw-r--r-- | app/views/authentication/_register.html.haml | 36 |
2 files changed, 55 insertions, 0 deletions
diff --git a/app/views/authentication/_authenticate.html.haml b/app/views/authentication/_authenticate.html.haml new file mode 100644 index 00000000000..17e855dbddd --- /dev/null +++ b/app/views/authentication/_authenticate.html.haml @@ -0,0 +1,19 @@ +#js-authenticate-token-2fa +%a.btn.btn-block.btn-info#js-login-2fa-device{ href: '#' }= _("Sign in via 2FA code") + +%script#js-authenticate-token-2fa-in-progress{ type: "text/template" } + %p= _("Trying to communicate with your device. Plug it in (if you haven't already) and press the button on the device now.") + +%script#js-authenticate-token-2fa-error{ type: "text/template" } + %div + %p <%= error_message %> (<%= error_name %>) + %a.btn.btn-block.btn-warning#js-token-2fa-try-again= _("Try again?") + +%script#js-authenticate-token-2fa-authenticated{ type: "text/template" } + %div + %p= _("We heard back from your device. You have been authenticated.") + = form_tag(target_path, method: :post, id: 'js-login-token-2fa-form') do |f| + - if render_remember_me + - resource_params = params[resource_name].presence || params + = hidden_field_tag 'user[remember_me]', resource_params.fetch(:remember_me, 0) + = hidden_field_tag 'user[device_response]', nil, class: 'form-control', required: true, id: "js-device-response" diff --git a/app/views/authentication/_register.html.haml b/app/views/authentication/_register.html.haml new file mode 100644 index 00000000000..f1aa76d115a --- /dev/null +++ b/app/views/authentication/_register.html.haml @@ -0,0 +1,36 @@ +#js-register-token-2fa + +%script#js-register-2fa-message{ type: "text/template" } + %p <%= message %> + +%script#js-register-token-2fa-setup{ type: "text/template" } + - if current_user.two_factor_otp_enabled? + .row.gl-mb-3 + .col-md-5 + %button#js-setup-token-2fa-device.btn.btn-info= _("Set up new device") + .col-md-7 + %p= _("Your device needs to be set up. Plug it in (if needed) and click the button on the left.") + - else + .row.gl-mb-3 + .col-md-4 + %button#js-setup-token-2fa-device.btn.btn-info.btn-block{ disabled: true }= _("Set up new device") + .col-md-8 + %p= _("You need to register a two-factor authentication app before you can set up a device.") + +%script#js-register-token-2fa-error{ type: "text/template" } + %div + %p + %span <%= error_message %> (<%= error_name %>) + %a.btn.btn-warning#js-token-2fa-try-again= _("Try again?") + +%script#js-register-token-2fa-registered{ type: "text/template" } + .row.gl-mb-3 + .col-md-12 + %p= _("Your device was successfully set up! Give it a name and register it with the GitLab server.") + = form_tag(target_path, method: :post) do + .row.gl-mb-3 + .col-md-3 + = text_field_tag 'device_registration[name]', nil, class: 'form-control', placeholder: _("Pick a name") + .col-md-3 + = hidden_field_tag 'device_registration[device_response]', nil, class: 'form-control', required: true, id: "js-device-response" + = submit_tag _("Register device"), class: "btn btn-success" |