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) => {
1818 const adminApp = nuxtApp . $firebaseAdminApp as AdminApp
1919 const adminAuth = getAdminAuth ( adminApp )
2020
21+ // log('debug', '🔥 Plugin auth user server')
22+
2123 const decodedToken = await decodeUserToken (
2224 getCookie ( event , AUTH_COOKIE_NAME ) ,
2325 adminApp
@@ -36,6 +38,8 @@ export default defineNuxtPlugin(async (nuxtApp) => {
3638 // for SSR
3739 nuxtApp . payload . vuefireUser = user ?. toJSON ( )
3840
41+ // log('debug', '🧍 User on server', user?.displayName || user?.uid)
42+
3943 // user that has a similar shape for client and server code
4044 nuxtApp [
4145 // 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) => {
4444 // TODO: do we need a randomId?
4545 const appName = `auth:${ user . uid } :${ randomId } `
4646
47- log ( 'log' , '👤 creating new app' , appName )
47+ // log('log', '👤 creating new app', appName)
4848
4949 appCache . set ( uid , initializeApp ( appConfig . firebaseConfig , appName ) )
5050 firebaseApp = appCache . get ( uid ) !
Original file line number Diff line number Diff line change @@ -8,5 +8,6 @@ import { defineNuxtPlugin } from '#app'
88export default defineNuxtPlugin ( ( nuxtApp ) => {
99 const firebaseApp = nuxtApp . $firebaseApp as FirebaseApp
1010
11+ // @ts -expect-error: FIXME: type it
1112 VueFireAuth ( nuxtApp . payload . vuefireUser ) ( firebaseApp , nuxtApp . vueApp )
1213} )
Original file line number Diff line number Diff line change @@ -56,17 +56,14 @@ export function VueFireAppCheckServer(
5656 log ( 'info' , 'Getting Admin AppCheck' )
5757 const adminAppCheck = getAdminAppCheck ( adminApp )
5858 // 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 ! } .` )
6360
6461 return adminAppCheck
6562 . createToken ( firebaseApp . options . appId ! , { ttlMillis } )
6663 . then ( ( { token, ttlMillis : expireTimeMillis } ) => {
6764 log (
6865 'info' ,
69- `Got AppCheck token from the server: ${ token } , expires in ${ expireTimeMillis } ms.`
66+ `Got AppCheck token from the server, expires in ${ expireTimeMillis } ms.`
7067 )
7168 // expire the token after the ttl
7269 // TODO: verify this is okay
You can’t perform that action at this time.
0 commit comments