mirror of
https://github.com/versia-pub/frontend.git
synced 2026-03-13 03:29:16 +01:00
feat: ✨ Add error page on login when the correct URI parameters are missing
This commit is contained in:
parent
714781bfde
commit
73ca0fb18b
5 changed files with 38 additions and 7 deletions
|
|
@ -13,7 +13,17 @@ useHead({
|
|||
|
||||
const host = new URL(useBaseUrl().value).host;
|
||||
const instance = useInstanceFromClient(new Client(new URL(useBaseUrl().value)));
|
||||
const { error, error_description } = useUrlSearchParams();
|
||||
const {
|
||||
error,
|
||||
error_description,
|
||||
redirect_uri,
|
||||
response_type,
|
||||
client_id,
|
||||
scope,
|
||||
state,
|
||||
} = useUrlSearchParams();
|
||||
const hasValidUrlSearchParams =
|
||||
redirect_uri && response_type && client_id && scope;
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -63,10 +73,23 @@ const { error, error_description } = useUrlSearchParams();
|
|||
})">
|
||||
</p>
|
||||
</div>
|
||||
<UserAuthForm v-if="instance" :instance="instance" />
|
||||
<div v-else class="p-4 flex items-center justify-center h-48">
|
||||
<UserAuthForm v-if="instance && hasValidUrlSearchParams" :instance="instance" />
|
||||
<div v-else-if="hasValidUrlSearchParams" class="p-4 flex items-center justify-center h-48">
|
||||
<Loader class="size-8 animate-spin" />
|
||||
</div>
|
||||
<Alert v-else variant="destructive" class="mb-4">
|
||||
<AlertCircle class="size-4" />
|
||||
<AlertTitle>{{ m.grand_spry_goldfish_embrace() }}</AlertTitle>
|
||||
<AlertDescription>
|
||||
<p>{{ m.gray_clean_shark_comfort() }}</p>
|
||||
<ul class="list-disc list-inside mt-2 font-mono">
|
||||
<li>redirect_uri</li>
|
||||
<li>response_type</li>
|
||||
<li>client_id</li>
|
||||
<li>scope</li>
|
||||
</ul>
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue