Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
1de6acbfff
|
|||
|
b002db4547
|
|||
|
1bdbd0a5c5
|
|||
|
883ec55b73
|
|||
|
|
c515fb76e6 |
@@ -16,7 +16,7 @@ A lightweight JWT implementation with ZERO dependencies for Cloudflare Workers.
|
||||
## Install
|
||||
|
||||
```
|
||||
npm i -D @tsndr/cloudflare-worker-jwt
|
||||
npm i @tsndr/cloudflare-worker-jwt
|
||||
```
|
||||
|
||||
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@tsndr/cloudflare-worker-jwt",
|
||||
"version": "2.1.2",
|
||||
"version": "2.1.4",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@tsndr/cloudflare-worker-jwt",
|
||||
"version": "2.1.2",
|
||||
"version": "2.1.4",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@cloudflare/workers-types": "^3.13.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tsndr/cloudflare-worker-jwt",
|
||||
"version": "2.1.2",
|
||||
"version": "2.1.4",
|
||||
"description": "A lightweight JWT implementation with ZERO dependencies for Cloudflare Worker",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
|
||||
@@ -196,6 +196,7 @@ export async function sign(payload: JwtPayload, secret: string, options: JwtSign
|
||||
if (!algorithm)
|
||||
throw new Error('algorithm not found')
|
||||
|
||||
if (!payload.iat)
|
||||
payload.iat = Math.floor(Date.now() / 1000)
|
||||
|
||||
const payloadAsJSON = JSON.stringify(payload)
|
||||
|
||||
Reference in New Issue
Block a user