diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2016-06-06 10:20:39 +0530 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-06-06 12:50:31 +0530 |
commit | 86b07caa599a7f064e9077770b1a87c670d7607c (patch) | |
tree | 21717ae881f78fddccab7de6fcb817dcdfc1da65 /app/views/u2f | |
parent | 128549f10beb406333fa23c1693750c06ff7bc4a (diff) | |
download | gitlab-ce-86b07caa599a7f064e9077770b1a87c670d7607c.tar.gz |
Implement authentication (login) using a U2F device.
- Move the `authenticate_with_two_factor` method from
`ApplicationController` to the `AuthenticatesWithTwoFactor` module,
where it should be.
Diffstat (limited to 'app/views/u2f')
-rw-r--r-- | app/views/u2f/_authenticate.html.haml | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/app/views/u2f/_authenticate.html.haml b/app/views/u2f/_authenticate.html.haml new file mode 100644 index 00000000000..75fb0e303ad --- /dev/null +++ b/app/views/u2f/_authenticate.html.haml @@ -0,0 +1,28 @@ +#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. + %a.btn.btn-info#js-login-u2f-device{ href: 'javascript:void(0)' } Login Via U2F Device + +%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| + = 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(); |