Skip to content

Commit 788d332

Browse files
Fix App Check swallowing errors and returning cached token
1 parent a24a76a commit 788d332

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/honest-days-lick.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/app-check': minor
3+
---
4+
5+
Fix App Check swallowing errors and returning cached token

packages/app-check/src/api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ export async function getToken(
206206
appCheckInstance as AppCheckService,
207207
forceRefresh
208208
);
209-
if (result.error) {
210-
throw result.error;
209+
if (result.internalError) {
210+
throw result.internalError;
211211
}
212212
return { token: result.token };
213213
}

0 commit comments

Comments
 (0)