2026-03-11 23:33:10 +00:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { Form, Head } from '@inertiajs/vue3';
|
|
|
|
|
import InputError from '@/components/InputError.vue';
|
|
|
|
|
import TextLink from '@/components/TextLink.vue';
|
|
|
|
|
import { Button } from '@/components/ui/button';
|
|
|
|
|
import { Input } from '@/components/ui/input';
|
|
|
|
|
import { Label } from '@/components/ui/label';
|
|
|
|
|
import { Spinner } from '@/components/ui/spinner';
|
|
|
|
|
import AuthBase from '@/layouts/AuthLayout.vue';
|
|
|
|
|
import { login } from '@/routes';
|
|
|
|
|
import { store } from '@/routes/register';
|
2026-03-27 15:16:45 +01:00
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
invitation?: string;
|
|
|
|
|
invitationEmail?: string;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const props = withDefaults(defineProps<Props>(), {
|
|
|
|
|
invitation: undefined,
|
|
|
|
|
invitationEmail: undefined,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const loginUrl = props.invitation
|
|
|
|
|
? `${login()}?invitation=${props.invitation}`
|
|
|
|
|
: login();
|
2026-03-11 23:33:10 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<AuthBase
|
2026-03-27 15:16:45 +01:00
|
|
|
:title="invitation ? 'Rejoindre l\'espace de travail' : 'Create an account'"
|
|
|
|
|
:description="invitation ? 'Créez votre compte pour accepter l\'invitation' : 'Enter your details below to create your account'"
|
2026-03-11 23:33:10 +00:00
|
|
|
>
|
2026-03-27 15:16:45 +01:00
|
|
|
<Head :title="invitation ? 'Rejoindre l\'espace de travail' : 'Register'" />
|
2026-03-11 23:33:10 +00:00
|
|
|
|
|
|
|
|
<Form
|
|
|
|
|
v-bind="store.form()"
|
|
|
|
|
:reset-on-success="['password', 'password_confirmation']"
|
|
|
|
|
v-slot="{ errors, processing }"
|
|
|
|
|
class="flex flex-col gap-6"
|
|
|
|
|
>
|
2026-03-27 15:16:45 +01:00
|
|
|
<input v-if="invitation" type="hidden" name="invitation" :value="invitation" />
|
|
|
|
|
|
2026-03-11 23:33:10 +00:00
|
|
|
<div class="grid gap-6">
|
|
|
|
|
<div class="grid gap-2">
|
|
|
|
|
<Label for="name">Name</Label>
|
|
|
|
|
<Input
|
|
|
|
|
id="name"
|
|
|
|
|
type="text"
|
|
|
|
|
required
|
|
|
|
|
autofocus
|
|
|
|
|
:tabindex="1"
|
|
|
|
|
autocomplete="name"
|
|
|
|
|
name="name"
|
|
|
|
|
placeholder="Full name"
|
|
|
|
|
/>
|
|
|
|
|
<InputError :message="errors.name" />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="grid gap-2">
|
|
|
|
|
<Label for="email">Email address</Label>
|
|
|
|
|
<Input
|
|
|
|
|
id="email"
|
|
|
|
|
type="email"
|
|
|
|
|
required
|
|
|
|
|
:tabindex="2"
|
|
|
|
|
autocomplete="email"
|
|
|
|
|
name="email"
|
2026-03-27 15:16:45 +01:00
|
|
|
:placeholder="invitationEmail ?? 'email@example.com'"
|
|
|
|
|
:value="invitationEmail"
|
|
|
|
|
:readonly="!!invitationEmail"
|
2026-03-11 23:33:10 +00:00
|
|
|
/>
|
|
|
|
|
<InputError :message="errors.email" />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="grid gap-2">
|
|
|
|
|
<Label for="password">Password</Label>
|
|
|
|
|
<Input
|
|
|
|
|
id="password"
|
|
|
|
|
type="password"
|
|
|
|
|
required
|
|
|
|
|
:tabindex="3"
|
|
|
|
|
autocomplete="new-password"
|
|
|
|
|
name="password"
|
|
|
|
|
placeholder="Password"
|
|
|
|
|
/>
|
|
|
|
|
<InputError :message="errors.password" />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="grid gap-2">
|
|
|
|
|
<Label for="password_confirmation">Confirm password</Label>
|
|
|
|
|
<Input
|
|
|
|
|
id="password_confirmation"
|
|
|
|
|
type="password"
|
|
|
|
|
required
|
|
|
|
|
:tabindex="4"
|
|
|
|
|
autocomplete="new-password"
|
|
|
|
|
name="password_confirmation"
|
|
|
|
|
placeholder="Confirm password"
|
|
|
|
|
/>
|
|
|
|
|
<InputError :message="errors.password_confirmation" />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<Button
|
|
|
|
|
type="submit"
|
|
|
|
|
class="mt-2 w-full"
|
|
|
|
|
tabindex="5"
|
|
|
|
|
:disabled="processing"
|
|
|
|
|
data-test="register-user-button"
|
|
|
|
|
>
|
|
|
|
|
<Spinner v-if="processing" />
|
|
|
|
|
Create account
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="text-center text-sm text-muted-foreground">
|
|
|
|
|
Already have an account?
|
|
|
|
|
<TextLink
|
2026-03-27 15:16:45 +01:00
|
|
|
:href="loginUrl"
|
2026-03-11 23:33:10 +00:00
|
|
|
class="underline underline-offset-4"
|
|
|
|
|
:tabindex="6"
|
|
|
|
|
>Log in</TextLink
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
</Form>
|
|
|
|
|
</AuthBase>
|
|
|
|
|
</template>
|