diff --git a/app/pages/auth.vue b/app/pages/auth.vue index a57c643..2979fe3 100644 --- a/app/pages/auth.vue +++ b/app/pages/auth.vue @@ -47,12 +47,25 @@ const loginRole = computed(() => { const isNewUser = ref(false) const checkingEmail = ref(false) +const showTos = ref(false) +const waiverTrigger = ref(null) + +function restoreWaiverFocus(event: Event) { + event.preventDefault() + waiverTrigger.value?.focus() +} +const waiverDate = new Date().toLocaleDateString(undefined, { + year: 'numeric', month: 'long', day: 'numeric', +}) const schema = computed(() => { if (isNewUser.value) { return z.object({ email: z.string().email('Invalid email'), name: z.string().min(1, 'Name is required'), + tosCheck: z.literal(true, { + message: 'You must accept the Terms of Service to create an account.', + }), }) } @@ -64,6 +77,7 @@ const schema = computed(() => { const state = reactive({ email: '', name: '', + tosCheck: false, }) async function sendMagicLink(callbackURL: string) { @@ -95,6 +109,7 @@ async function handleSubmit(_event: FormSubmitEvent) { email: state.email, name: state.name, role: loginRole.value, + tosCheck: state.tosCheck, }, }).catch((error) => { toast.add({ @@ -167,6 +182,8 @@ async function handleSubmit(_event: FormSubmitEvent) { description: 'Please enter your name to create an account.', color: 'primary', }) + + } @@ -233,6 +250,83 @@ async function handleSubmit(_event: FormSubmitEvent) { /> + +
+ + + +
+
+ + + + +