trim all text inputs on signup actions
All checks were successful
deploy / build-and-deploy (/testvaro, /opt/website-test, website-test) (push) Successful in 22s
deploy / build-and-deploy (/varo, /opt/website, website) (push) Successful in 23s

This commit is contained in:
2025-06-09 21:36:45 +02:00
parent e770a72f9d
commit afd3541d4d

View File

@ -7,18 +7,18 @@ import { getSetting, SettingKey } from '@util/settings.ts';
export const signup = { export const signup = {
signup: defineAction({ signup: defineAction({
input: z.object({ input: z.object({
firstname: z.string().min(2), firstname: z.string().trim().min(2),
lastname: z.string().min(2), lastname: z.string().trim().min(2),
// this will be inaccurate as it is evaluated only once // this will be inaccurate as it is evaluated only once
birthday: z birthday: z
.string() .string()
.date() .date()
.max(Date.now() - 1000 * 60 * 60 * 24 * 365 * 6), .max(Date.now() - 1000 * 60 * 60 * 24 * 365 * 6),
phone: z.string().nullable(), phone: z.string().trim().nullable(),
username: z.string(), username: z.string().trim(),
teamMember: z.string(), teamMember: z.string().trim(),
teamName: z.string().nullable() teamName: z.string().trim().nullable()
}), }),
handler: async (input) => { handler: async (input) => {
// check if signup is allowed // check if signup is allowed