Integrate feedback
This commit is contained in:
1 parent
93431fd01f
commit
2a0b651d74
3 files changed
+35
-62
No files matched your search
@@ -52,8 +52,6 @@ export const dict = {
|
||||
},
|
||||
allow: "Allow",
|
||||
deny: "Deny",
|
||||
noAccess: "Your role does not have access to {{ client }}",
|
||||
back: "Back",
|
||||
error: {
|
||||
noChallenge: "No consent challenge was provided",
|
||||
invalidChallenge: "An invalid consent challenge was provided",
|
||||
|
||||
+35
-59
@@ -43,66 +43,42 @@ export default function ConsentPage() {
|
||||
<div class="flex flex-col items-center gap-4">
|
||||
<h1 class="text-2xl font-bold">{t("consent.title")}</h1>
|
||||
|
||||
<Show
|
||||
when={consentData()?.allowed !== false}
|
||||
fallback={
|
||||
<>
|
||||
<h2 class="text-lg text-center">
|
||||
{t("consent.noAccess", {
|
||||
client: consentData()?.clientName ?? "",
|
||||
<h2 class="text-lg">
|
||||
{t("consent.clientWouldLikeTo", {
|
||||
client: consentData()?.clientName ?? "",
|
||||
})}
|
||||
</h2>
|
||||
<ul class="list-disc">
|
||||
<For each={consentData()?.scopes}>
|
||||
{(scope) => (
|
||||
<li>
|
||||
{t(scopeMap.get("") ?? "consent.scopes.default", {
|
||||
scope,
|
||||
})}
|
||||
</h2>
|
||||
<div class="w-full py-2 flex flex-col gap-2">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() =>
|
||||
consent(false, params.consent_challenge as string)
|
||||
}
|
||||
class="btn btn-soft"
|
||||
>
|
||||
{t("consent.back")}
|
||||
</button>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
>
|
||||
<h2 class="text-lg">
|
||||
{t("consent.clientWouldLikeTo", {
|
||||
client: consentData()?.clientName ?? "",
|
||||
})}
|
||||
</h2>
|
||||
<ul class="list-disc">
|
||||
<For each={consentData()?.scopes}>
|
||||
{(scope) => (
|
||||
<li>
|
||||
{t(scopeMap.get("") ?? "consent.scopes.default", {
|
||||
scope,
|
||||
})}
|
||||
</li>
|
||||
)}
|
||||
</For>
|
||||
</ul>
|
||||
<div class="w-full py-2 flex flex-col gap-2">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() =>
|
||||
consent(true, params.consent_challenge as string)
|
||||
}
|
||||
class="btn btn-success"
|
||||
>
|
||||
{t("consent.allow")}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() =>
|
||||
consent(false, params.consent_challenge as string)
|
||||
}
|
||||
class="btn btn-error"
|
||||
>
|
||||
{t("consent.deny")}
|
||||
</button>
|
||||
</div>
|
||||
</Show>
|
||||
</li>
|
||||
)}
|
||||
</For>
|
||||
</ul>
|
||||
<div class="w-full py-2 flex flex-col gap-2">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() =>
|
||||
consent(true, params.consent_challenge as string)
|
||||
}
|
||||
class="btn btn-success"
|
||||
>
|
||||
{t("consent.allow")}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() =>
|
||||
consent(false, params.consent_challenge as string)
|
||||
}
|
||||
class="btn btn-error"
|
||||
>
|
||||
{t("consent.deny")}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
export type ConsentData = {
|
||||
allowed: boolean;
|
||||
skip: boolean;
|
||||
clientName: string;
|
||||
scopes: string[];
|
||||
|
||||
Reference in new issue
Block a user