Skip to content

Commit

Permalink
docs: fix auth demo function mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow committed May 8, 2024
1 parent f70a7be commit f0c7a58
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: Date.now() + 60 * 60 * 24 * 7, // 有效期为 7 天
exp: Math.floor(Date.now()/1000) + 60 * 60 * 24 * 7, // 有效期为 7 天
}
const token = cloud.getToken(payload)

Expand Down

0 comments on commit f0c7a58

Please sign in to comment.