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 = {
signup: defineAction({
input: z.object({
firstname: z.string().min(2),
lastname: z.string().min(2),
firstname: z.string().trim().min(2),
lastname: z.string().trim().min(2),
// this will be inaccurate as it is evaluated only once
birthday: z
.string()
.date()
.max(Date.now() - 1000 * 60 * 60 * 24 * 365 * 6),
phone: z.string().nullable(),
username: z.string(),
phone: z.string().trim().nullable(),
username: z.string().trim(),
teamMember: z.string(),
teamName: z.string().nullable()
teamMember: z.string().trim(),
teamName: z.string().trim().nullable()
}),
handler: async (input) => {
// check if signup is allowed