Skip to content

Commit f7b956d

Browse files
committed
fix(app-check): avoid picking up variable in prod
1 parent 4980c83 commit f7b956d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

packages/nuxt/src/module.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,16 @@ export default defineNuxtModule<VueFireNuxtModuleOptions>({
9797
// plugins
9898

9999
if (options.appCheck) {
100-
if (process.env.FIREBASE_APPCHECK_DEBUG_TOKEN) {
100+
if (
101+
process.env.FIREBASE_APPCHECK_DEBUG_TOKEN &&
102+
// only use the debug token if the user explicitly set debug to true or if nothing was provided and we are not in production
103+
(options.appCheck.debug === true ||
104+
(options.appCheck.debug == null &&
105+
process.env.NODE_ENV !== 'production'))
106+
) {
107+
logger.debug(
108+
`Using app check debug token from env variable "${process.env.FIREBASE_APPCHECK_DEBUG_TOKEN}"`
109+
)
101110
options.appCheck.debug = process.env.FIREBASE_APPCHECK_DEBUG_TOKEN
102111
}
103112
addPlugin(resolve(runtimeDir, 'app-check/plugin.client'))

0 commit comments

Comments
 (0)