Skip to content

Commit

Permalink
fix: typos, consistent current date
Browse files Browse the repository at this point in the history
  • Loading branch information
njlie committed Aug 24, 2022
1 parent c65ccc0 commit 8b6a1b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/auth/src/accessToken/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ async function rotateToken(
access_token: {
access: result.access.map((a) => accessToBody(a)),
value: result.value,
manage: deps.config.authServerDomain + `/token${result.managementId}`,
manage: deps.config.authServerDomain + `/token/${result.managementId}`,
expires_in: result.expiresIn
}
}
Expand Down
5 changes: 3 additions & 2 deletions packages/auth/src/client/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,10 @@ function isClientInfo(client: unknown): client is ClientInfo {
}

function isJwkViable(keys: RegistryKey): boolean {
const currentDate = new Date()
return !!(
(!keys.exp || new Date() < new Date(keys.exp * 1000)) &&
(!keys.nbf || new Date() >= new Date(keys.nbf * 1000))
(!keys.exp || currentDate < new Date(keys.exp * 1000)) &&
(!keys.nbf || currentDate >= new Date(keys.nbf * 1000))
)
}

Expand Down

0 comments on commit 8b6a1b5

Please sign in to comment.