Skip to content

Commit 95b4488

Browse files
committed
iat for cookie minting
1 parent 6636162 commit 95b4488

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/firebase-aware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const mintCookie = async (req: Request, res: Response) => {
3333
const idToken = req.header('Authorization')?.split('Bearer ')?.[1];
3434
const verifiedIdToken = idToken ? await adminAuth.verifyIdToken(idToken) : null;
3535
if (verifiedIdToken) {
36-
if (new Date().getTime() / 1_000 - (verifiedIdToken.auth_time || verifiedIdToken.iat) > ID_TOKEN_MAX_AGE) {
36+
if (new Date().getTime() / 1_000 - verifiedIdToken.iat > ID_TOKEN_MAX_AGE) {
3737
res.status(301).end();
3838
} else {
3939
const cookie = await adminAuth.createSessionCookie(idToken!, { expiresIn: COOKIE_MAX_AGE }).catch((e: any) => {

0 commit comments

Comments
 (0)