forked from alterminal/alterminal
first commit
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
{{/* 授權同意頁(/authorize)。以 layout.html(側邊導覽欄版面)為根模板
|
||||
組合渲染,本檔僅定義區塊。使用者已登入(Session 有效)才會看到本
|
||||
頁:顯示發起授權的應用程式名稱與其要求的 scope 清單,送出同意或
|
||||
拒絕。原始授權請求的每個參數以隱藏欄位原封帶回 POST /authorize。 */}}
|
||||
{{define "title"}}授權存取 - alterminal{{end}}
|
||||
|
||||
{{define "content"}}
|
||||
<section class="rounded-xl bg-white p-8 shadow-lg dark:bg-neutral-800 dark:shadow-black/40">
|
||||
<h1 class="mb-1 text-xl font-semibold">授權存取</h1>
|
||||
<p class="mb-6 text-sm text-neutral-500 dark:text-neutral-400">
|
||||
應用程式 <strong class="text-neutral-900 dark:text-neutral-100">{{.AppName}}</strong> 要求以下權限:
|
||||
</p>
|
||||
{{if .Error}}<p class="mb-4 rounded-lg bg-red-500/10 px-3 py-2.5 text-sm text-red-600 dark:text-red-400" role="alert">{{.Error}}</p>{{end}}
|
||||
<ul class="mb-6 list-none space-y-2 p-0">
|
||||
{{range .Scopes}}
|
||||
<li class="flex flex-col gap-0.5 rounded-lg border border-neutral-200 px-3.5 py-2.5 dark:border-neutral-700">
|
||||
<span class="font-mono text-sm font-medium">{{.Scope}}</span>
|
||||
<span class="text-sm text-neutral-500 dark:text-neutral-400">{{.Description}}</span>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
<form method="post" action="/authorize">
|
||||
{{range $k, $vs := .Params}}{{range $vs}}<input type="hidden" name="{{$k}}" value="{{.}}">{{end}}{{end}}
|
||||
<input type="hidden" name="csrf_token" value="{{.CSRF}}">
|
||||
<div class="flex flex-col gap-3 sm:flex-row">
|
||||
<button type="submit" name="decision" value="allow"
|
||||
class="rounded-lg bg-brand px-5 py-2.5 text-sm font-semibold text-white hover:bg-brand-strong">同意</button>
|
||||
<button type="submit" name="decision" value="deny"
|
||||
class="rounded-lg border border-neutral-300 px-5 py-2.5 text-sm font-semibold hover:bg-neutral-100 dark:border-neutral-600 dark:hover:bg-neutral-700">拒絕</button>
|
||||
</div>
|
||||
</form>
|
||||
<p class="mt-4 text-xs text-neutral-400 dark:text-neutral-500">同意後,之後來自同一應用程式且範圍相同的授權請求將不再詢問。</p>
|
||||
</section>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user