♻️ 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'">
<turnstile v-if="!!apiKey" :sitekey="apiKey" @callback="handleSuccess" />
<div v-else class="mx-auto">
<n-spin />
<span class="loading loading-spinner loading-md"></span>
</div>
</div>
<div v-else-if="provider === 'hcaptcha'">
@@ -11,9 +11,10 @@
v-if="!!apiKey"
:sitekey="apiKey"
@verify="(tk: string) => handleSuccess(tk)"
/>
>
</hcaptcha>
<div v-else class="mx-auto">
<n-spin />
<span class="loading loading-spinner loading-md"></span>
</div>
</div>
<div
@@ -22,7 +23,7 @@
:data-sitekey="apiKey"
/>
<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>
</div>
</div>
@@ -32,6 +33,7 @@
import { ref, onMounted } from "vue"
import Turnstile from "cfturnstile-vue3"
import Hcaptcha from "@hcaptcha/vue3-hcaptcha"
import { AlertTriangleIcon } from "lucide-vue-next"
const props = defineProps({
provider: {

View File

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

View File

@@ -1,32 +1,27 @@
<template>
<div class="d-flex align-center justify-center fill-height">
<v-card
class="pa-6 text-center"
max-width="600"
title="Captcha Verification"
>
<v-card-text>
<div class="mb-8 mt-4">
<client-only>
<captcha-widget @verified="onCaptchaVerified" />
</client-only>
</div>
<div>
<div class="text-sm font-bold mb-1">Solar Network Anti-Robot</div>
<div class="opacity-80 text-xs">
Hosted by
<a
href="https://github.com/Solsynth/DysonNetwork"
class="text-primary"
target="_blank"
rel="noopener noreferrer"
>
DysonNetwork.Sphere
</a>
</div>
</div>
</v-card-text>
</v-card>
<div class="flex flex-col items-center justify-center h-compact-layout">
<div class="mb-4">
<client-only>
<captcha-widget @verified="onCaptchaVerified" />
</client-only>
</div>
<div class="text-center">
<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">
Hosted by
<a
href="https://github.com/Solsynth/DysonNetwork"
class="text-primary"
target="_blank"
rel="noopener noreferrer"
>
DysonNetwork.Sphere
</a>
</div>
</div>
</div>
</template>