mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Merge pull request #3835 from omnivore-app/fix/guess-user-email
return UNKNOWN as error code if email exists when user signs up
This commit is contained in:
commit
3dcc514be7
2 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -90,12 +90,12 @@ describe('auth router', () => {
|
|||
await deleteUser(user.id)
|
||||
})
|
||||
|
||||
it('redirects to sign up page with error code USER_EXISTS', async () => {
|
||||
it('redirects to sign up page with error code UNKNOWN', async () => {
|
||||
const res = await signupRequest(email, password, name, username).expect(
|
||||
302
|
||||
)
|
||||
expect(res.header.location).to.endWith(
|
||||
'/email-signup?errorCodes=USER_EXISTS'
|
||||
'/email-signup?errorCodes=UNKNOWN'
|
||||
)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue