Skip to content

Commit

Permalink
fix(app-check): app-check is actually defined on server too
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Jul 27, 2023
1 parent fd0494d commit 359f9d0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/app-check/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,20 @@ export function VueFireAppCheck(options: VueFireAppCheckOptions) {
}
}

// TODO: remove this as getAppCheck() already kinda does this
/**
* To retrieve the current app check
* @internal
*/
export const AppCheckMap = new WeakMap<FirebaseApp, AppCheck>()

// TODO: this should be available on the server too
/**
* Retrieves the Firebase App Check instance. Note this is only available on the client and will be `undefined` on the
* server.
* Retrieves the Firebase App Check instance.
*
* @param name - name of the application
*/
export function useAppCheck(name?: string) {
return AppCheckMap.get(useFirebaseApp(name))
return AppCheckMap.get(useFirebaseApp(name))!
}

/**
Expand Down

0 comments on commit 359f9d0

Please sign in to comment.