{{/*### Handler=/settings/2fa TitleBar=Two Factor Authentication KyutGrill=settings2.jpg Include=menu.html MinPrivileges=2 */}} {{ define "tpl" }}
{{ template "settingsSidebar" . }}
{{ $e := is2faEnabled .Context.User.ID }} {{ if $e }}
{{ .T "Two factor authentication is enabled on your account." }}
{{ else }}
{{ .T "Two factor authentication is not enabled on your account." }}
{{ end }}
{{ if eq $e 0 }}

{{ .T "Google Authenticator (TOTP) based 2FA" }}

{{ $k := generateKey .Context }}

{{ .T "Scan this from Google Authenticator, or if you're not able to, provide to Google Authenticator this key: %s. Once you've done, fill out the following form with the code you get on Google Authenticator and click on enter to enable TOTP-based two factor authentication." $k.Secret | html }}

{{ csrfGenerate .Context.User.ID }} {{ ieForm .Gin }}
{{ else }}

{{ if eq $e 1 }} {{ .T "At the moment you currently have set up Telegram Two Factor Authentication. Should you wish to disable it, please fill out the following form:" }} {{ else }} {{ .T "At the moment you currently have set up TOTP-based (Google Authenticator) Two Factor Authentication. Should you wish to disable it, please fill out the following form:" }} {{ end }}

{{ csrfGenerate .Context.User.ID }} {{ ieForm .Gin }}
{{ if eq $e 2 }}

{{ .T "Google Authenticator recovery keys" }}

{{ .T "These are the only thing that will let you get back into your Ripple account if you lose your device. Our suggestion is to paste them inside a document in your word processor (Microsoft Word, LibreOffice Writer), print them and store them in a safe place." }}

{{ range getKeys .Context.User.ID }}
{{ . }}
{{ end }}
{{ end }} {{ end }}
{{ end }}