✨ Add catpcha, callback
This commit is contained in:
19
app/layouts/minimal.vue
Normal file
19
app/layouts/minimal.vue
Normal file
@@ -0,0 +1,19 @@
|
||||
<template>
|
||||
<v-app :theme="isDark ? 'dark' : 'light'">
|
||||
<v-app-bar flat height="48">
|
||||
<v-container class="mx-auto d-flex align-center justify-center">
|
||||
<p class="text-sm">Solar Network</p>
|
||||
</v-container>
|
||||
</v-app-bar>
|
||||
|
||||
<v-main>
|
||||
<slot />
|
||||
</v-main>
|
||||
</v-app>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useCustomTheme } from "~/composables/useCustomTheme"
|
||||
|
||||
const { isDark } = useCustomTheme()
|
||||
</script>
|
17
app/pages/auth/callback.vue
Normal file
17
app/pages/auth/callback.vue
Normal file
@@ -0,0 +1,17 @@
|
||||
<template>
|
||||
<div class="d-flex align-center justify-center fill-height">
|
||||
<v-card class="pa-6 text-center" max-width="400">
|
||||
<v-card-text>
|
||||
<v-icon size="64" color="success" class="mb-4">mdi-check-circle</v-icon>
|
||||
<h2 class="text-xl font-bold">Auth completed</h2>
|
||||
<p class="opacity-80">Now you can close this tab</p>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
definePageMeta({
|
||||
layout: "minimal"
|
||||
})
|
||||
</script>
|
55
app/pages/auth/captcha.vue
Normal file
55
app/pages/auth/captcha.vue
Normal file
@@ -0,0 +1,55 @@
|
||||
<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>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useRoute } from "vue-router"
|
||||
import CaptchaWidget from "@/components/CaptchaWidget.vue"
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
const onCaptchaVerified = (token: string) => {
|
||||
if (window.parent !== window) {
|
||||
window.parent.postMessage(`captcha_tk=${token}`, "*")
|
||||
}
|
||||
|
||||
const redirectUri = route.query.redirect_uri as string
|
||||
if (redirectUri) {
|
||||
window.location.href = `${redirectUri}?captcha_tk=${encodeURIComponent(
|
||||
token
|
||||
)}`
|
||||
}
|
||||
}
|
||||
|
||||
definePageMeta({
|
||||
layout: "minimal"
|
||||
})
|
||||
</script>
|
Reference in New Issue
Block a user