Compare commits

..

2 Commits

Author SHA1 Message Date
afd3541d4d 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
2025-06-09 21:36:45 +02:00
e770a72f9d fix admin panel user add having an invalid id 2025-06-09 20:42:37 +02:00
2 changed files with 7 additions and 7 deletions

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

View File

@ -35,7 +35,7 @@ export async function addUser(user: User) {
return;
}
addToWritableArray(users, user);
addToWritableArray(users, Object.assign(user, { id: data.id }));
}
export async function editUser(user: User) {