diff --git a/src/controllers/auth-controller.ts b/src/controllers/auth-controller.ts index c0cb9d9b6c33f1d18b7e77bdd239aebca8d84d32..cb1044b670700a2e36f32f12d880da02f2653b1f 100644 --- a/src/controllers/auth-controller.ts +++ b/src/controllers/auth-controller.ts @@ -37,8 +37,8 @@ const setFingerprintCookie = ( res: Response, fingerprint: string, ): void => { - res.cookie("Secure-fingerprint", fingerprint, { - maxAge: 60 * 15 * 1000, // 15 minutes max age (same as access token expiry) + res.cookie("__Secure-fingerprint", fingerprint, { + maxAge: 60 * 60, // 60 minutes max age (same as access token expiry) httpOnly: true, secure: true, }); diff --git a/src/utils/token.ts b/src/utils/token.ts index 3aee8b72a5d9a451c51e5c3eeb36b8fbcd5fb514..a6162c1a7e5bd0550077278f84329b0b6d5dee7e 100644 --- a/src/utils/token.ts +++ b/src/utils/token.ts @@ -31,7 +31,7 @@ const generateAccessTokenAndFingerprint = async (data: { process.env.JWT_SHARED_SECRET as string, { algorithm: "HS256", // Only use HS256 to generate JWTs - expiresIn: "24h", // The token expires after 1 hour + expiresIn: "60m", // The token expires 60 minutes notBefore: "0ms", // The token is valid right away issuer: "Tonality REST Service", },