2016-06-06 00:50:39 -04:00
|
|
|
#js-authenticate-u2f
|
|
|
|
|
|
|
|
%script#js-authenticate-u2f-not-supported{ type: "text/template" }
|
|
|
|
%p Your browser doesn't support U2F. Please use Google Chrome desktop (version 41 or newer).
|
|
|
|
|
|
|
|
%script#js-authenticate-u2f-setup{ type: "text/template" }
|
|
|
|
%div
|
|
|
|
%p Insert your security key (if you haven't already), and press the button below.
|
2016-09-09 08:21:00 -04:00
|
|
|
%a.btn.btn-info#js-login-u2f-device{ href: 'javascript:void(0)' } Sign in via U2F device
|
2016-06-06 00:50:39 -04:00
|
|
|
|
|
|
|
%script#js-authenticate-u2f-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-u2f-error{ type: "text/template" }
|
|
|
|
%div
|
|
|
|
%p <%= error_message %>
|
|
|
|
%a.btn.btn-warning#js-u2f-try-again Try again?
|
|
|
|
|
|
|
|
%script#js-authenticate-u2f-authenticated{ type: "text/template" }
|
|
|
|
%div
|
|
|
|
%p We heard back from your U2F device. Click this button to authenticate with the GitLab server.
|
|
|
|
= form_tag(new_user_session_path, method: :post) do |f|
|
2016-08-19 21:51:56 -04:00
|
|
|
- resource_params = params[resource_name].presence || params
|
|
|
|
= hidden_field_tag 'user[remember_me]', resource_params.fetch(:remember_me, 0)
|
2016-06-06 00:50:39 -04:00
|
|
|
= hidden_field_tag 'user[device_response]', nil, class: 'form-control', required: true, id: "js-device-response"
|
|
|
|
= submit_tag "Authenticate via U2F Device", class: "btn btn-success"
|
|
|
|
|
|
|
|
:javascript
|
|
|
|
var u2fAuthenticate = new U2FAuthenticate($("#js-authenticate-u2f"), gon.u2f);
|
|
|
|
u2fAuthenticate.start();
|