Skip to content

Commit

Permalink
Merge pull request #3987 from activepieces/fix/old-token-1
Browse files Browse the repository at this point in the history
fix: revert old token
  • Loading branch information
abuaboud committed Feb 21, 2024
2 parents 57e4c4d + 4f8e75a commit 1709d38
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions packages/server/api/src/app/helper/jwt-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { localFileStore } from './store'
import { QueueMode, SystemProp, system } from 'server-shared'
import { promisify } from 'util'
import { randomBytes } from 'crypto'
import dayjs from 'dayjs'

export enum JwtSignAlgorithm {
HS256 = 'HS256',
Expand Down Expand Up @@ -121,20 +120,6 @@ export const jwtUtils = {
if (err) {
return reject(err)
}

// Todo - remove after old tokens has been invalidated, maybe after (April 2024), remove the hardcoded date
const decodedToken = jwtLibrary.decode(jwt, {
json: true,
})
if (decodedToken?.exp && decodedToken.exp !== 1754223678 && decodedToken.exp > dayjs().add(2, 'weeks').unix()) {
throw new ActivepiecesError({
code: ErrorCode.INVALID_BEARER_TOKEN,
params: {
message: 'Old token in use. Please login again.',
},
})
}

return resolve(payload as T)
})
})
Expand Down

0 comments on commit 1709d38

Please sign in to comment.