Skip to content

Commit

Permalink
Update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DellaBitta committed Dec 17, 2024
1 parent a218674 commit e6b6625
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
3 changes: 0 additions & 3 deletions packages/app/src/firebaseServerApp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,6 @@ describe('FirebaseServerApp', () => {
);
} catch (e) {
encounteredError = true;
//expect((e as Error).toString()).to.contain(
// 'Unexpected end of JSON input'
//);
}
expect(encounteredError).to.be.true;
});
Expand Down
5 changes: 2 additions & 3 deletions packages/app/src/firebaseServerApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ function validateTokenTTL(base64Token: string, tokenName: string): void {
}
const exp = JSON.parse(secondPart).exp * 1000;
const now = new Date().getTime();
// const now = new Date(new Date().getDate() - 1).now()
const diff = exp - now;
if (diff <= 0) {
throw ERROR_FACTORY.create(AppError.SERVER_APP_TOKEN_EXPIRED, {
Expand Down Expand Up @@ -94,12 +93,12 @@ export class FirebaseServerAppImpl
...serverConfig
};

// Validate the authIdtoken validation window.
// Ensure that the current time is within the authIdtoken window of validity.
if (this._serverConfig.authIdToken) {
validateTokenTTL(this._serverConfig.authIdToken, 'authIdToken');
}

// Validate the appCheckToken validation window.
// Ensure that the current time is within the appCheckToken window of validity.
if (this._serverConfig.appCheckToken) {
validateTokenTTL(this._serverConfig.appCheckToken, 'appCheckToken');
}
Expand Down

0 comments on commit e6b6625

Please sign in to comment.