Skip to content

Commit 5add0af

Browse files
committed
refactor: isClient
1 parent 840ca8b commit 5add0af

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/app-check/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ export function VueFireAppCheck(options: VueFireAppCheckOptions) {
6767
}
6868
}
6969

70+
// TODO: split the function above into two, one that provides the token and is used in both server and client and another one that is only used on the client
71+
7072
/**
7173
* To retrieve the current app check
7274
* @internal

src/auth/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { getAuth, User } from 'firebase/auth'
33
import { App, ref, shallowRef } from 'vue-demi'
44
import { useFirebaseApp } from '../app'
55
import { getGlobalScope } from '../globals'
6-
import { _Nullable } from '../shared'
6+
import { isClient, _Nullable } from '../shared'
77
import { authUserMap, setupOnAuthStateChanged } from './user'
88

99
export {
@@ -47,5 +47,5 @@ export function VueFireAuth(initialUser?: _Nullable<User>) {
4747
* @returns the Auth instance
4848
*/
4949
export function useFirebaseAuth(name?: string) {
50-
return typeof window === 'undefined' ? null : getAuth(useFirebaseApp(name))
50+
return isClient ? getAuth(useFirebaseApp(name)) : null
5151
}

0 commit comments

Comments
 (0)