♻️ Migrated some auth pages

This commit is contained in:
2025-11-29 19:10:37 +08:00
parent 7a4a13736e
commit 8d28e8a6ad
3 changed files with 30 additions and 33 deletions

View File

@@ -3,7 +3,7 @@
<div v-if="provider === 'cloudflare'"> <div v-if="provider === 'cloudflare'">
<turnstile v-if="!!apiKey" :sitekey="apiKey" @callback="handleSuccess" /> <turnstile v-if="!!apiKey" :sitekey="apiKey" @callback="handleSuccess" />
<div v-else class="mx-auto"> <div v-else class="mx-auto">
<n-spin /> <span class="loading loading-spinner loading-md"></span>
</div> </div>
</div> </div>
<div v-else-if="provider === 'hcaptcha'"> <div v-else-if="provider === 'hcaptcha'">
@@ -11,9 +11,10 @@
v-if="!!apiKey" v-if="!!apiKey"
:sitekey="apiKey" :sitekey="apiKey"
@verify="(tk: string) => handleSuccess(tk)" @verify="(tk: string) => handleSuccess(tk)"
/> >
</hcaptcha>
<div v-else class="mx-auto"> <div v-else class="mx-auto">
<n-spin /> <span class="loading loading-spinner loading-md"></span>
</div> </div>
</div> </div>
<div <div
@@ -22,7 +23,7 @@
:data-sitekey="apiKey" :data-sitekey="apiKey"
/> />
<div v-else class="flex flex-col items-center justify-center gap-1"> <div v-else class="flex flex-col items-center justify-center gap-1">
<span class="mdi mdi-alert-circle-outline text-3xl"></span> <n-icon :component="AlertTriangleIcon" />
<span>Captcha provider not configured correctly.</span> <span>Captcha provider not configured correctly.</span>
</div> </div>
</div> </div>
@@ -32,6 +33,7 @@
import { ref, onMounted } from "vue" import { ref, onMounted } from "vue"
import Turnstile from "cfturnstile-vue3" import Turnstile from "cfturnstile-vue3"
import Hcaptcha from "@hcaptcha/vue3-hcaptcha" import Hcaptcha from "@hcaptcha/vue3-hcaptcha"
import { AlertTriangleIcon } from "lucide-vue-next"
const props = defineProps({ const props = defineProps({
provider: { provider: {

View File

@@ -28,6 +28,6 @@ definePageMeta({
onMounted(() => { onMounted(() => {
const redirectUrl = `${apiBase}/id/auth/callback/${provider}${window.location.search}` const redirectUrl = `${apiBase}/id/auth/callback/${provider}${window.location.search}`
// window.location.href = redirectUrl window.location.href = redirectUrl
}) })
</script> </script>

View File

@@ -1,18 +1,15 @@
<template> <template>
<div class="d-flex align-center justify-center fill-height"> <div class="flex flex-col items-center justify-center h-compact-layout">
<v-card <div class="mb-4">
class="pa-6 text-center"
max-width="600"
title="Captcha Verification"
>
<v-card-text>
<div class="mb-8 mt-4">
<client-only> <client-only>
<captcha-widget @verified="onCaptchaVerified" /> <captcha-widget @verified="onCaptchaVerified" />
</client-only> </client-only>
</div> </div>
<div> <div class="text-center">
<div class="text-sm font-bold mb-1">Solar Network Anti-Robot</div> <div class="text-sm font-bold">Solar Network Anti-Robot</div>
<p class="opacity-80 text-sm mb-2">
You might need to wait a while before the puzzle fully loaded.
</p>
<div class="opacity-80 text-xs"> <div class="opacity-80 text-xs">
Hosted by Hosted by
<a <a
@@ -25,8 +22,6 @@
</a> </a>
</div> </div>
</div> </div>
</v-card-text>
</v-card>
</div> </div>
</template> </template>