feat(): Add support for jwt asymetric keys (#12813)
* feat(): Add support for jwt asymetric keys * Create early-chefs-chew.md * fix unit tests * Add verify options support * feedback * fix unit tests
This commit is contained in:
committed by
GitHub
parent
a833c3c98c
commit
d517dbd66a
10
packages/modules/user/src/utils/utils.ts
Normal file
10
packages/modules/user/src/utils/utils.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import timespan from "jsonwebtoken/lib/timespan"
|
||||
|
||||
export function getExpiresAt(expiresIn: string | number) {
|
||||
const expiresAt =
|
||||
typeof expiresIn === "number"
|
||||
? new Date(Date.now() + expiresIn * 1000)
|
||||
: new Date(Math.floor(timespan(expiresIn)) * 1000)
|
||||
|
||||
return expiresAt
|
||||
}
|
||||
Reference in New Issue
Block a user