Skip to content

Commit

Permalink
fix: use the default access token expiration time
Browse files Browse the repository at this point in the history
  • Loading branch information
colorfield committed Oct 8, 2024
1 parent fbe09a1 commit de1a52f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions apps/preview/server/utils/oAuth2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ declare module 'express-session' {

// In seconds
export const SESSION_MAX_AGE = 300;
export const ACCESS_TOKEN_EXPIRATION_TIME = 300;

const ENCRYPTION_KEY =
process.env.ENCRYPTION_KEY || crypto.randomBytes(32).toString('hex');
Expand Down Expand Up @@ -250,7 +249,7 @@ export const isAuthenticated = async (req: Request): Promise<boolean> => {
let result = false;
let accessToken = getPersistedAccessToken(req);
if (accessToken) {
if (!accessToken.expired(ACCESS_TOKEN_EXPIRATION_TIME)) {
if (!accessToken.expired()) {
result = true;
} else {
try {
Expand Down

0 comments on commit de1a52f

Please sign in to comment.