funny things
This commit is contained in:
parent
7a0f9d1c90
commit
e4f373ef6e
2 changed files with 14 additions and 6 deletions
|
@ -23,6 +23,8 @@
|
|||
});
|
||||
|
||||
|
||||
let random = Math.trunc(Math.random() * 10);
|
||||
|
||||
</script>
|
||||
|
||||
<div class="w-full h-full flex justify-center items-center">
|
||||
|
@ -36,7 +38,11 @@
|
|||
<Tabs.Content value="login">
|
||||
<Card.Root>
|
||||
<Card.Header>
|
||||
<Card.Title>🌳 - Arbres</Card.Title>
|
||||
{#if random > 8}
|
||||
<Card.Title>🌳 - Arabes</Card.Title>
|
||||
{:else}
|
||||
<Card.Title>🌳 - Arbres</Card.Title>
|
||||
{/if}
|
||||
<Card.Description>Connectez vous pour chatter!</Card.Description>
|
||||
</Card.Header>
|
||||
<form method="POST" action="?/login" use:enhance>
|
||||
|
@ -60,7 +66,11 @@
|
|||
<Tabs.Content value="register">
|
||||
<Card.Root>
|
||||
<Card.Header>
|
||||
<Card.Title>🌳 - Arbres</Card.Title>
|
||||
{#if random > 8}
|
||||
<Card.Title>🌳 - Arabes</Card.Title>
|
||||
{:else}
|
||||
<Card.Title>🌳 - Arbres</Card.Title>
|
||||
{/if}
|
||||
<Card.Description>Inscrivez-vous pour chatter!</Card.Description>
|
||||
</Card.Header>
|
||||
<form method="POST" action="?/register" use:enhance>
|
||||
|
|
|
@ -8,9 +8,9 @@ export async function POST({request}) {
|
|||
const formData = await request.formData();
|
||||
|
||||
// @ts-ignore
|
||||
const username: string = formData.get('username').toString();
|
||||
const username: string = formData.get('username').toString().toLowerCase();
|
||||
// @ts-ignore
|
||||
const email: string = formData.get('email').toString();
|
||||
const email: string = formData.get('email').toString().toLowerCase();
|
||||
// @ts-ignore
|
||||
const password: string = formData.get('password').toString();
|
||||
|
||||
|
@ -28,9 +28,7 @@ export async function POST({request}) {
|
|||
return error(400, {message: "Un compte avec cette adresse email ou nom d'utilisateur existe déjà."});
|
||||
}
|
||||
|
||||
logger.debug(`No user found with email (${email}) in database`);
|
||||
try {
|
||||
|
||||
const hash = await argon2.hash(password);
|
||||
|
||||
const newUser = await prismaClient.user.create({
|
||||
|
|
Loading…
Add table
Reference in a new issue