Files
pages/templates/partials/auth_cli.gohtml
T
Anya Tokugawa 93f4ecb8f4
Build and publish container images / images (push) Successful in 14m31s
Release container images / release (push) Successful in 27s
Enable CLI language-aware editing and reuse OIDC authentication
2026-11-01 21:31:04 +09:00

21 lines
1.0 KiB
Go Template

{{ define "auth-cli" }}
{{ if .CLIDone }}
<p role="status">{{ T "auth.cli_done" }}</p>
{{ else }}
<p>{{ T "auth.cli_warning" }}</p>
<p><strong>{{ .CLIOrigin }}</strong></p>
{{ if .CLILogin }}
<a class="auth-provider-button" href="{{ .CLILogin }}">{{ T "auth.login_oidc" }}</a>
{{ else }}
<p>{{ T "auth.cli_account" }}: <strong>{{ .CLIUsername }}</strong></p>
<p>{{ T "auth.cli_access" }}</p>
<form class="auth-form" method="post" action="/_/auth/cli/verify">
<input type="hidden" name="request" value="{{ .CLIRequest }}">
<input type="hidden" name="csrf" value="{{ .CLICSRF }}">
<label>{{ T "auth.cli_code" }}<input name="user_code" autocomplete="off" autocapitalize="characters" spellcheck="false" maxlength="9" required autofocus placeholder="ABCD-1234"></label>
<button class="auth-primary" type="submit" name="decision" value="approve">{{ T "auth.cli_approve" }}</button>
<button class="auth-secondary" type="submit" name="decision" value="deny" formnovalidate>{{ T "auth.cli_deny" }}</button>
</form>
{{ end }}{{ end }}
{{ end }}