diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2016-06-10 13:37:05 +0300 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-06-15 05:46:11 +0300 |
commit | fbb06125938a6c4dd1a046b6d08ad37040f62672 (patch) | |
tree | 586e702449ecfe7c48476d21dc56d26d00ab71c2 /app/views/u2f/_register.html.haml | |
parent | f34af6b83cc2663bb8a076f4df9c82047e5511ab (diff) |
Don't allow clicking on "Setup New U2F Device" unless an authenticator app has been set up.
- Also change the help message to indicate that an authenticator app is
now a prerequisite for U2F.
Diffstat (limited to 'app/views/u2f/_register.html.haml')
-rw-r--r-- | app/views/u2f/_register.html.haml | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/app/views/u2f/_register.html.haml b/app/views/u2f/_register.html.haml index 46af591fc43..cbb8dfb7829 100644 --- a/app/views/u2f/_register.html.haml +++ b/app/views/u2f/_register.html.haml @@ -4,11 +4,18 @@ %p Your browser doesn't support U2F. Please use Google Chrome desktop (version 41 or newer). %script#js-register-u2f-setup{ type: "text/template" } - .row.append-bottom-10 - .col-md-3 - %a#js-setup-u2f-device.btn.btn-info{ href: 'javascript:void(0)' } Setup New U2F Device - .col-md-9 - %p Your U2F device needs to be set up. Plug it in (if not already) and click the button on the left. + - if current_user.two_factor_otp_enabled? + .row.append-bottom-10 + .col-md-3 + %button#js-setup-u2f-device.btn.btn-info Setup New U2F Device + .col-md-9 + %p Your U2F device needs to be set up. Plug it in (if not already) and click the button on the left. + - else + .row.append-bottom-10 + .col-md-3 + %button#js-setup-u2f-device.btn.btn-info{ disabled: true } Setup New U2F Device + .col-md-9 + %p.text-warning You need to register a two-factor authentication app before you can set up a U2F device. %script#js-register-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. |