Skip to content

Commit

Permalink
docs: fix jwt token exp time
Browse files Browse the repository at this point in the history
  • Loading branch information
nightwhite authored Jan 5, 2024
1 parent f1e7297 commit 6109c2d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/zh/cloud-function/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import cloud from '@lafjs/cloud'
export default async function (ctx: FunctionContext) {
const payload = {
user_id: 123,
exp: 60 * 60 * 24 * 7, // 有效期为 7 天
exp: Date.now() + 60 * 60 * 24 * 7, // 有效期为 7 天
}
const token = cloud.getToken(payload)

Expand Down

0 comments on commit 6109c2d

Please sign in to comment.