File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <template >
2+ <div class =" flex flex-col items-center justify-center h-screen gap-4" >
3+ <div class =" size-8 border-4 border-gray-300 border-t-gray-600 rounded-full animate-spin" />
4+ <p class =" text-sm text-gray-500" >Signing you in...</p >
5+ </div >
6+ </template >
7+
8+ <script setup lang="ts">
9+ const { isSignedIn, getToken } = useAuth ()
10+
11+ onMounted (() => {
12+ watch (isSignedIn , async (signedIn ) => {
13+ if (signedIn ) {
14+ await getToken .value ()
15+ navigateTo (" /" )
16+ }
17+ }, { immediate: true })
18+ })
19+ </script >
Original file line number Diff line number Diff line change 1+ <template >
2+ <div class =" flex items-center justify-center h-screen" >
3+ <SignedOut >
4+ <SignInButton
5+ class="rounded-lg border border-gray-900 px-10 py-2 hover:bg-gray-900 hover:text-white transition-colors"
6+ />
7+ </SignedOut >
8+ <SignedIn >
9+ <UserButton />
10+ </SignedIn >
11+ </div >
12+ </template >
13+
14+ <script setup lang="ts">
15+ const { isSignedIn, getToken } = useAuth ()
16+
17+ if (import .meta .client && isSignedIn .value ) {
18+ await getToken .value ()
19+ navigateTo (" /" )
20+ }
21+ </script >
You can’t perform that action at this time.
0 commit comments