Skip to content

Commit

Permalink
docs: fix jwt token exp time (#1778)
Browse files Browse the repository at this point in the history
  • Loading branch information
nightwhite committed Jan 5, 2024
1 parent 44df222 commit dd4c28d
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 dd4c28d

Please sign in to comment.