Add TOTP Token to account
This commit is contained in:
parent
b9795be745
commit
da32b67981
21 changed files with 724 additions and 13 deletions
|
|
@ -26,6 +26,11 @@
|
|||
<div class="pure-u-1">
|
||||
<div class="pure-button-group" role="group" role="Actions">
|
||||
<a class="pure-button" href="/auth/password/">Change Password</a>
|
||||
{{ if .User.TOTPEnabled }}
|
||||
<a class="pure-button" href="/auth/totp/disable/">Disable TOTP</a>
|
||||
{{ else }}
|
||||
<a class="pure-button" href="/auth/totp/enable/">Enable TOTP</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
17
internal/dis/component/auth/templates/totp_disable.html
Normal file
17
internal/dis/component/auth/templates/totp_disable.html
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{{ template "_form.html" . }}
|
||||
{{ define "form/title" }}Disable TOTP{{ end }}
|
||||
{{ define "form/button" }}Disable{{ end }}
|
||||
{{ define "form/extra" }}
|
||||
<div>
|
||||
<a class="pure-button" href="/auth/">Back</a>
|
||||
<hr />
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ define "form/inside" }}
|
||||
<div>
|
||||
<ul>
|
||||
<li>remove the TOTP token from your account</li>
|
||||
<li>your account will be less secure, but you will be able to login without it</li>
|
||||
</ul>
|
||||
</div>
|
||||
{{ end }}
|
||||
18
internal/dis/component/auth/templates/totp_enable.html
Normal file
18
internal/dis/component/auth/templates/totp_enable.html
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{{ template "_form.html" . }}
|
||||
{{ define "form/title" }}Enable TOTP{{ end }}
|
||||
{{ define "form/button" }}Enable{{ end }}
|
||||
{{ define "form/extra" }}
|
||||
<div>
|
||||
<a class="pure-button" href="/auth/">Back</a>
|
||||
<hr />
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ define "form/inside" }}
|
||||
<div>
|
||||
<ul>
|
||||
<li>Use this page to add a <a href="https://en.wikipedia.org/wiki/Time-based_one-time_password">TOTP</a> token to your account</li>
|
||||
<li>You will not be able to login without the second factor</li>
|
||||
<li>If you forget your token, only an administrator can reset it</li>
|
||||
</ul>
|
||||
</div>
|
||||
{{ end }}
|
||||
20
internal/dis/component/auth/templates/totp_enroll.html
Normal file
20
internal/dis/component/auth/templates/totp_enroll.html
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{{ template "_form.html" . }}
|
||||
{{ define "form/title" }}Enable TOTP{{ end }}
|
||||
{{ define "form/button" }}Enable{{ end }}
|
||||
{{ define "form/extra" }}
|
||||
<div>
|
||||
<a class="pure-button" href="/auth/">Back</a>
|
||||
<hr />
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ define "form/inside" }}
|
||||
<div>
|
||||
<a href="{{ .TOTPURL }}">
|
||||
<img src="{{ .TOTPImage }}" alt="TOTP Enrollment Image">
|
||||
</a>
|
||||
<ul>
|
||||
<li>scan the token above using a <a href="https://en.wikipedia.org/wiki/Time-based_one-time_password">TOTP</a>app on your phone</li>
|
||||
<li>enter your current password and the now generated token to confirm</li>
|
||||
</ul>
|
||||
</div>
|
||||
{{ end }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue