From 8c3ec9d6df2c88fece3e1659fa857ce9219656ce Mon Sep 17 00:00:00 2001 From: unleashit Date: Mon, 11 Mar 2024 00:56:36 -0700 Subject: [PATCH] fix(demo): improve errors on signup route --- demos/backend/src/routes/signup.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/demos/backend/src/routes/signup.ts b/demos/backend/src/routes/signup.ts index 51311ee2..0811bede 100644 --- a/demos/backend/src/routes/signup.ts +++ b/demos/backend/src/routes/signup.ts @@ -21,6 +21,10 @@ const demoUsers = [ email: 'test2@test2.com', password: '12345678', }, + { + email: 'existing@user.com', + password: '12345678', + }, ]; function validations({ email, password, passwordConfirm }: PostBody) { @@ -43,7 +47,8 @@ function validations({ email, password, passwordConfirm }: PostBody) { } if (demoUsers.find((u) => u.email === email)) { - errors.root = 'That email is already associated with an account'; + errors.root = 'This email is already associated with an account'; + errors.email = 'Please login instead or choose a different email'; } return errors;