File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -122,10 +122,12 @@ export class ContextProvider {
122
122
async getAppCheckToken ( ) : Promise < string | null > {
123
123
if ( this . appCheck ) {
124
124
const result = await this . appCheck . getToken ( ) ;
125
- // If getToken() fails, it will still return a dummy token that also has
126
- // an error field containing the error message. We will send any token
127
- // provided here and show an error if/when it is rejected by the functions
128
- // endpoint.
125
+ if ( result . error ) {
126
+ // Do not send the App Check header to the functions endpoint if
127
+ // there was an error from the App Check exchange endpoint. The App
128
+ // Check SDK will already have logged the error to console.
129
+ return null ;
130
+ }
129
131
return result . token ;
130
132
}
131
133
return null ;
You can’t perform that action at this time.
0 commit comments