Skip to content

Commit d7b6cf2

Browse files
committed
Address PR comments
1 parent 0f34629 commit d7b6cf2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/app-check/src/api.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export function activate(
6464
// Read cached token from storage if it exists and store it in memory.
6565
newState.cachedTokenPromise = readTokenFromStorage(app).then(cachedToken => {
6666
if (cachedToken && isValid(cachedToken)) {
67-
newState.token = cachedToken;
67+
setState(app, { ...getState(app), token: cachedToken });
6868
}
6969
return cachedToken;
7070
});

packages/app-check/src/internal-api.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export async function getToken(
6464
* If there is no token in memory, try to load token from indexedDB.
6565
*/
6666
if (!token) {
67-
// readTokenFromStorage() always resolves. In case of an error, it resolves with `undefined`.
67+
// cachedTokenPromise contains the token found in IndexedDB or undefined if not found.
6868
const cachedToken = await state.cachedTokenPromise;
6969
if (cachedToken && isValid(cachedToken)) {
7070
token = cachedToken;

0 commit comments

Comments
 (0)