File tree Expand file tree Collapse file tree 1 file changed +18
-10
lines changed
packages/nuxt/src/runtime/app-check Expand file tree Collapse file tree 1 file changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -17,21 +17,29 @@ export default defineNuxtPlugin((nuxtApp) => {
17
17
const options = appConfig . vuefireOptions . appCheck !
18
18
const firebaseApp = nuxtApp . $firebaseApp as FirebaseApp
19
19
20
- // Add a default provider for production
21
- // TODO: make this a dev only warning
22
- let provider : AppCheckOptions [ 'provider' ] = new CustomProvider ( {
23
- getToken : ( ) =>
24
- Promise . reject (
25
- process . env . NODE_ENV !== 'production'
26
- ? new Error ( `[VueFire]: Unknown Provider "${ options . provider } ".` )
27
- : new Error ( 'app-check/invalid-provider' )
28
- ) ,
29
- } )
20
+ let provider : AppCheckOptions [ 'provider' ]
30
21
31
22
if ( options . provider === 'ReCaptchaV3' ) {
32
23
provider = new ReCaptchaV3Provider ( options . key )
33
24
} else if ( options . provider === 'ReCaptchaEnterprise' ) {
34
25
provider = new ReCaptchaEnterpriseProvider ( options . key )
26
+ } else {
27
+ // default provider that fails
28
+ // TODO: make this a dev only warning
29
+ provider = new CustomProvider ( {
30
+ getToken : ( ) =>
31
+ Promise . reject (
32
+ process . env . NODE_ENV !== 'production'
33
+ ? new Error (
34
+ `[VueFire]: Unknown Provider "${
35
+ // @ts -expect-error: options.provider is never here
36
+ options . provider
37
+ } ".`
38
+ // eslint-disable-next-line indent
39
+ )
40
+ : new Error ( 'app-check/invalid-provider' )
41
+ ) ,
42
+ } )
35
43
}
36
44
37
45
VueFireAppCheck ( {
You can’t perform that action at this time.
0 commit comments