mirror of
https://git.suyu.dev/suyu/website.git
synced 2026-01-08 23:48:06 +01:00
fix exploit (i think?)
This commit is contained in:
parent
2d28049b2a
commit
713810f81b
2 changed files with 20 additions and 2 deletions
|
|
@ -39,6 +39,12 @@ export async function POST({ request, getClientAddress }) {
|
|||
error: "missing fields",
|
||||
});
|
||||
}
|
||||
if (body.username.length < 3 || body.username.length > 24) {
|
||||
return json<CreateAccountResponse>({
|
||||
success: false,
|
||||
error: "invalid username",
|
||||
});
|
||||
}
|
||||
if (!validator.isEmail(body.email)) {
|
||||
return json<CreateAccountResponse>({
|
||||
success: false,
|
||||
|
|
|
|||
|
|
@ -61,8 +61,20 @@
|
|||
>Contact us</a
|
||||
>.
|
||||
</p>
|
||||
<input bind:value={emailInput} class="input" type="text" placeholder="Recovery Email" />
|
||||
<input bind:value={usernameInput} class="input" type="text" placeholder="Username" />
|
||||
<input
|
||||
bind:value={emailInput}
|
||||
maxlength="128"
|
||||
class="input"
|
||||
type="text"
|
||||
placeholder="Recovery Email"
|
||||
/>
|
||||
<input
|
||||
bind:value={usernameInput}
|
||||
maxlength="24"
|
||||
class="input"
|
||||
type="text"
|
||||
placeholder="Username"
|
||||
/>
|
||||
<div class="h-[78px]">
|
||||
<HCaptcha on:success={captchaComplete} theme="dark" sitekey={PUBLIC_SITE_KEY} />
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue