summaryrefslogtreecommitdiffstats
path: root/templates/user/settings
diff options
context:
space:
mode:
Diffstat (limited to 'templates/user/settings')
-rw-r--r--templates/user/settings/security.tmpl1
-rw-r--r--templates/user/settings/security_openid.tmpl2
-rw-r--r--templates/user/settings/security_u2f.tmpl56
3 files changed, 58 insertions, 1 deletions
diff --git a/templates/user/settings/security.tmpl b/templates/user/settings/security.tmpl
index 8e7044f7df..c2c99c7979 100644
--- a/templates/user/settings/security.tmpl
+++ b/templates/user/settings/security.tmpl
@@ -4,6 +4,7 @@
<div class="ui container">
{{template "base/alert" .}}
{{template "user/settings/security_twofa" .}}
+ {{template "user/settings/security_u2f" .}}
{{template "user/settings/security_accountlinks" .}}
{{if .EnableOpenIDSignIn}}
{{template "user/settings/security_openid" .}}
diff --git a/templates/user/settings/security_openid.tmpl b/templates/user/settings/security_openid.tmpl
index 82a05f3885..a16501acfa 100644
--- a/templates/user/settings/security_openid.tmpl
+++ b/templates/user/settings/security_openid.tmpl
@@ -43,7 +43,7 @@
{{.CsrfTokenHtml}}
<div class="required field {{if .Err_OpenID}}error{{end}}">
<label for="openid">{{.i18n.Tr "settings.add_new_openid"}}</label>
- <input id="openid" name="openid" type="text" autofocus required>
+ <input id="openid" name="openid" type="text" required>
</div>
<button class="ui green button">
{{.i18n.Tr "settings.add_openid"}}
diff --git a/templates/user/settings/security_u2f.tmpl b/templates/user/settings/security_u2f.tmpl
new file mode 100644
index 0000000000..4703f9deb9
--- /dev/null
+++ b/templates/user/settings/security_u2f.tmpl
@@ -0,0 +1,56 @@
+<h4 class="ui top attached header">
+{{.i18n.Tr "settings.u2f"}}
+</h4>
+<div class="ui attached segment">
+ <p>{{.i18n.Tr "settings.u2f_desc" | Str2html}}</p>
+ {{if .TwofaEnrolled}}
+ <div class="ui key list">
+ {{range .U2FRegistrations}}
+ <div class="item">
+ <div class="right floated content">
+ <button class="ui red tiny button delete-button" id="delete-registration" data-url="{{$.Link}}/u2f/delete" data-id="{{.ID}}">
+ {{$.i18n.Tr "settings.delete_key"}}
+ </button>
+ </div>
+ <div class="content">
+ <strong>{{.Name}}</strong>
+ </div>
+ </div>
+ {{end}}
+ </div>
+ <div class="ui form">
+ {{.CsrfTokenHtml}}
+ <div class="required field">
+ <label for="nickname">{{.i18n.Tr "settings.u2f_nickname"}}</label>
+ <input id="nickname" name="nickname" type="text" required>
+ </div>
+ <button id="register-security-key" class="positive ui labeled icon button"><i class="usb icon"></i>{{.i18n.Tr "settings.u2f_register_key"}}</button>
+ </div>
+ {{else}}
+ <b>{{.i18n.Tr "settings.u2f_require_twofa"}}</b>
+ {{end}}
+</div>
+
+<div class="ui small modal" id="register-device">
+ <div class="header">{{.i18n.Tr "settings.u2f_register_key"}}</div>
+ <div class="content">
+ <i class="notched spinner loading icon"></i> {{.i18n.Tr "settings.u2f_press_button"}}
+ </div>
+ <div class="actions">
+ <div class="ui cancel button">{{.i18n.Tr "cancel"}}</div>
+ </div>
+</div>
+
+{{template "user/auth/u2f_error" .}}
+
+<div class="ui small basic delete modal" id="delete-registration">
+ <div class="ui icon header">
+ <i class="trash icon"></i>
+ {{.i18n.Tr "settings.u2f_delete_key"}}
+ </div>
+ <div class="content">
+ <p>{{.i18n.Tr "settings.u2f_delete_key_desc"}}</p>
+ </div>
+ {{template "base/delete_modal_actions" .}}
+</div>
+