Skip to content

Commit

Permalink
feat: jwt sign token
Browse files Browse the repository at this point in the history
  • Loading branch information
wibus-wee committed Jun 23, 2024
1 parent e406c02 commit 87f01c4
Show file tree
Hide file tree
Showing 3 changed files with 2,373 additions and 2,758 deletions.
10 changes: 9 additions & 1 deletion packages/modules/locafe/notchnook/verify.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
import { ResponseDone } from '@as/shared'
import jwt from 'jsonwebtoken'

/**
* @url https://lo.cafe/api/notchnook-verify-key
*/
export function locafeNotchNook() {
const token = jwt.sign({
valid: false,
iat: Math.floor(Date.now() / 1000),
}, 'secret', {
algorithm: 'RS256',
})

return ResponseDone({
body: {
valid: true,
token,
},
})
}
6 changes: 5 additions & 1 deletion packages/modules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"@as/shared": "workspace:^"
"@as/shared": "workspace:^",
"jsonwebtoken": "^9.0.2"
},
"devDependencies": {
"@types/jsonwebtoken": "^9.0.6"
}
}
Loading

0 comments on commit 87f01c4

Please sign in to comment.