We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4a47968 commit 2bbbc51Copy full SHA for 2bbbc51
packages/functions/src/context.ts
@@ -122,10 +122,12 @@ export class ContextProvider {
122
async getAppCheckToken(): Promise<string | null> {
123
if (this.appCheck) {
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.
+ if (result.error) {
+ // Do not send the App Check header to the functions endpoint if
+ // there was an error from the App Check exchange endpoint. The App
+ // Check SDK will already have logged the error to console.
129
+ return null;
130
+ }
131
return result.token;
132
}
133
return null;
0 commit comments