{* SPDX-FileCopyrightText: © 2021 Olivier Meunier SPDX-License-Identifier: AGPL-3.0-only *} {{ extends "./base" }} {{ import "/_libs/forms" }} {{ block title() }}{{ gettext("Security") }}{{ end }} {{ block mainContent() }}

{{ yield title() }}

{{- if !user.Locked() -}}
{{ yield formErrors(form=.ChangeForm) }}
{{ gettext("Change my password") }} {{ yield passwordField( field=.ChangeForm.Get("current"), required=true, label=gettext("Current password"), class="field-h", inputAttrs=attrList("autocomplete", "current-password"), ) }} {{ yield passwordField( field=.ChangeForm.Get("password"), required=true, label=gettext("New password"), class="field-h", inputAttrs=attrList("autocomplete", "new-password"), help=gettext("must be at least 8 characters long"), ) }}

{{- end -}}
{{ gettext("Verification Code (TOTP)") }}

{{ gettext("A verification code is a one time code generated by an application, such as Google Authenticator.") }}

{{- if user.HasTOTP() -}}

{{- yield icon(name="o-check-on", class="svgicon text-green-700") }} {{ gettext("The verification code is enabled on this account.") -}}

{{- yield message(type="", icon="") content -}}
{{ gettext("Remove Verification Code") }}

{{- gettext("Removing your verification code will make your account less secure.") -}}

{{- end -}} {{- else -}}

{{ gettext("Setup Verification Code") }}

{{- end -}}
{{ end }}