Skip to content

Commit

Permalink
feat(app-check): automatically pick up env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Jul 21, 2023
1 parent 60f7839 commit ea864a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/nuxt/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ export default defineNuxtModule<VueFireNuxtModuleOptions>({
// plugins

if (options.appCheck) {
if (process.env.FIREBASE_APPCHECK_DEBUG_TOKEN) {
options.appCheck.debug = process.env.FIREBASE_APPCHECK_DEBUG_TOKEN
}
addPlugin(resolve(runtimeDir, 'app-check/plugin.client'))
// TODO: With emulators a different plugin should be used, one that doesn't instantiate app check as it will error on the server anyway
if (hasServiceAccount || emulatorsConfig) {
Expand Down
2 changes: 1 addition & 1 deletion src/app-check/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function useAppCheckToken() {
export interface VueFireAppCheckOptions extends AppCheckOptions {
/**
* Setups the debug token global. See https://firebase.google.com/docs/app-check/web/debug-provider. Note you should
* set to false in production (or not set it at all). It can be set to a string to force a specific token.
* set to false in production (or not set it at all). It can be set to a string to force a specific debug token.
*/
debug?: boolean | string
}
Expand Down

0 comments on commit ea864a6

Please sign in to comment.