Skip to content

Commit

Permalink
doc: fix login example param checking (labring#1494)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikaibenkai authored Aug 25, 2023
1 parent 339d208 commit fe53422
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/guide/quick-start/login.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export default async function (ctx: FunctionContext) {
const password = ctx.body?.password || "";

// check param
if (!/[a-zA-Z0-9]{3,16}/.test(username)) return { error: "invalid username" };
if (!/[a-zA-Z0-9]{3,16}/.test(password)) return { error: "invalid password" };
if (!/^[a-zA-Z0-9]{3,16}$/.test(username)) return { error: "invalid username" };
if (!/^[a-zA-Z0-9]{3,16}$/.test(password)) return { error: "invalid password" };

// check username existed
const db = cloud.database();
Expand Down

0 comments on commit fe53422

Please sign in to comment.