mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
add nuxt and expo with orpc
This commit is contained in:
24
apps/cli/templates/auth/web/nuxt/app/pages/login.vue
Normal file
24
apps/cli/templates/auth/web/nuxt/app/pages/login.vue
Normal file
@@ -0,0 +1,24 @@
|
||||
<script setup lang="ts">
|
||||
const { $authClient } = useNuxtApp();
|
||||
import SignInForm from "~/components/SignInForm.vue";
|
||||
import SignUpForm from "~/components/SignUpForm.vue";
|
||||
|
||||
const session = $authClient.useSession();
|
||||
const showSignIn = ref(true);
|
||||
|
||||
watchEffect(() => {
|
||||
if (!session?.value.isPending && session?.value.data) {
|
||||
navigateTo("/dashboard", { replace: true });
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<Loader v-if="session.isPending" />
|
||||
<div v-else-if="!session.data">
|
||||
<SignInForm v-if="showSignIn" @switch-to-sign-up="showSignIn = false" />
|
||||
<SignUpForm v-else @switch-to-sign-in="showSignIn = true" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user