File tree Expand file tree Collapse file tree 4 files changed +8
-6
lines changed
packages/nuxt/src/runtime Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ export default defineNuxtPlugin(async (nuxtApp) => {
18
18
const adminApp = nuxtApp . $firebaseAdminApp as AdminApp
19
19
const adminAuth = getAdminAuth ( adminApp )
20
20
21
+ // log('debug', '🔥 Plugin auth user server')
22
+
21
23
const decodedToken = await decodeUserToken (
22
24
getCookie ( event , AUTH_COOKIE_NAME ) ,
23
25
adminApp
@@ -36,6 +38,8 @@ export default defineNuxtPlugin(async (nuxtApp) => {
36
38
// for SSR
37
39
nuxtApp . payload . vuefireUser = user ?. toJSON ( )
38
40
41
+ // log('debug', '🧍 User on server', user?.displayName || user?.uid)
42
+
39
43
// user that has a similar shape for client and server code
40
44
nuxtApp [
41
45
// we cannot use symbol to index
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ export default defineNuxtPlugin(async (nuxtApp) => {
44
44
// TODO: do we need a randomId?
45
45
const appName = `auth:${ user . uid } :${ randomId } `
46
46
47
- log ( 'log' , '👤 creating new app' , appName )
47
+ // log('log', '👤 creating new app', appName)
48
48
49
49
appCache . set ( uid , initializeApp ( appConfig . firebaseConfig , appName ) )
50
50
firebaseApp = appCache . get ( uid ) !
Original file line number Diff line number Diff line change @@ -8,5 +8,6 @@ import { defineNuxtPlugin } from '#app'
8
8
export default defineNuxtPlugin ( ( nuxtApp ) => {
9
9
const firebaseApp = nuxtApp . $firebaseApp as FirebaseApp
10
10
11
+ // @ts -expect-error: FIXME: type it
11
12
VueFireAuth ( nuxtApp . payload . vuefireUser ) ( firebaseApp , nuxtApp . vueApp )
12
13
} )
Original file line number Diff line number Diff line change @@ -56,17 +56,14 @@ export function VueFireAppCheckServer(
56
56
log ( 'info' , 'Getting Admin AppCheck' )
57
57
const adminAppCheck = getAdminAppCheck ( adminApp )
58
58
// NOTE: appId is checked on the module
59
- log (
60
- 'info' ,
61
- `Getting creating token for app ${ firebaseApp . options . appId ! } .`
62
- )
59
+ log ( 'info' , `Creating token for app ${ firebaseApp . options . appId ! } .` )
63
60
64
61
return adminAppCheck
65
62
. createToken ( firebaseApp . options . appId ! , { ttlMillis } )
66
63
. then ( ( { token, ttlMillis : expireTimeMillis } ) => {
67
64
log (
68
65
'info' ,
69
- `Got AppCheck token from the server: ${ token } , expires in ${ expireTimeMillis } ms.`
66
+ `Got AppCheck token from the server, expires in ${ expireTimeMillis } ms.`
70
67
)
71
68
// expire the token after the ttl
72
69
// TODO: verify this is okay
You can’t perform that action at this time.
0 commit comments