File tree Expand file tree Collapse file tree 3 files changed +21
-7
lines changed Expand file tree Collapse file tree 3 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,13 @@ export default defineNuxtModule<ModuleOptions>({
173173 file : resolver . resolve ( './runtime/pages/SignUp.vue' ) ,
174174 } )
175175
176+ // Sign Out
177+ pages . unshift ( {
178+ name : 'signout' ,
179+ path : '/signout' ,
180+ file : resolver . resolve ( './runtime/pages/SignOut.vue' ) ,
181+ } )
182+
176183 // Account
177184 pages . unshift ( {
178185 name : 'account' ,
Original file line number Diff line number Diff line change @@ -4,16 +4,11 @@ import { navigateTo } from '#imports'
44
55export const useSignOut = ( ) => {
66 // App state
7- const auth = useFirebaseAuth ( ) !
7+ const auth = useFirebaseAuth ( )
88
99 const signOut = async ( redirectTo = '/signin' ) => {
10- if ( ! auth ) {
11- console . error ( 'Firebase auth not available.' )
12- return
13- }
14-
1510 // Sign out from Firebase Auth
16- await firebaseSignOut ( auth )
11+ if ( auth ) await firebaseSignOut ( auth )
1712
1813 // Redirect
1914 await navigateTo ( redirectTo )
Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ import { useSignOut } from ' #imports'
3+
4+ // STATE - GLOBAL
5+ const { signOut } = useSignOut ()
6+
7+ await signOut ()
8+ </script >
9+
10+ <template >
11+ <p >Signing out...</p >
12+ </template >
You can’t perform that action at this time.
0 commit comments