{{define "content"}}

Account

Signed in as {{.Principal.User.Username}} ({{.Principal.User.Role}}).

{{with .Data.NewToken}}

New API token

Copy it now. It will not be shown again.

{{.}}

Use it as Authorization: Bearer … or NOEMA_API_TOKEN for noemactl.

{{end}}

Sessions

{{range .Data.Sessions}}{{end}}
WhereClientLast seen
{{.IP}}{{if eq .ID $.Principal.SessionID}} current{{end}} {{.UserAgent}} {{ago .LastSeenAt}} {{if ne .ID $.Principal.SessionID}}
{{end}}

Change password

Other sessions are signed out when the password changes.

Two-factor authentication

{{if .Data.RecoveryCodes}}

Recovery codes. Store these somewhere safe; each works once and they are not shown again.

{{range .Data.RecoveryCodes}}{{.}}
{{end}}
{{end}} {{if .Data.TOTPEnabled}}

enabled {{.Data.RecoveryLeft}} recovery code(s) left.

{{else if .Data.TOTPSecret}}

Add this secret to your authenticator app, then confirm with a code.

Secret: {{.Data.TOTPSecret}}

URI: {{.Data.TOTPURI}}

{{else if .Data.TOTPAvailable}}

Off. Enabling it adds a code from an authenticator app to every sign-in and gives you ten single-use recovery codes.

{{else}}

Unavailable: the server has no NOEMA_MASTER_KEY, so the secret could not be stored encrypted.

{{end}}

API tokens

{{range .Data.Tokens}}{{else}}{{end}}
NameCreatedLast used
{{.Name}}{{date .CreatedAt}}{{if .LastUsedAt}}{{ago .LastUsedAt}}{{else}}never{{end}}
No tokens.
{{end}}