diff --git a/src/auth.ts b/src/auth.ts index 5a6e39d..3ad1a10 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -159,8 +159,16 @@ const authSignup = async (config: Config): Promise => { break; } catch (err) { const errorMessage = String((err as ProtocolError).response?.data); - warn(errorMessage); + if (errorMessage.includes('Account already exists')) { + info( + 'This email is already associated with an account. Please log in instead.' + ); + return await authLogin(config); + } + + warn(errorMessage); + email = password = passwordConfirmation = userAlias = ''; await askData();