return UNKNOWN if email exists when user signs up

This commit is contained in:
Hongbo Wu 2024-04-18 14:04:38 +08:00
parent 9ed94b4571
commit 22850bb6ab

View file

@ -37,7 +37,7 @@ export const createUser = async (input: {
const existingUser = await userRepository.findByEmail(trimmedEmail)
if (existingUser) {
if (existingUser.profile) {
return Promise.reject({ errorCode: SignupErrorCode.UserExists })
return Promise.reject({ errorCode: SignupErrorCode.Unknown })
}
// create profile if user exists but profile does not exist