Issue: Redirect New Customers to Sign in Instead of Login
Description
New customers should not be able to log in directly, as they do not yet have an account. Instead of allowing login attempts from new users, they should be redirected to the sign-up page to create an account. This will prevent confusion and improve the user experience.
Requirements
During the login attempt, if a new customer (email not found) tries to log in, they should be redirected to the sign-up page.
Display a message such as "It seems you don't have an account. Please sign up to continue."
Include a link to the sign-up page in the error message.
Ensure no login action is taken for non-existing users.
Expected Behavior
When a new customer (without an account) tries to log in, they should be shown a message like "You don't have an account yet. Please sign up first."
They should be redirected to the sign-up page instead of being allowed to log in.
Tasks
[ ] Implement a check to verify if the customer exists in the database during login attempts.
[ ] If the user doesn't exist, redirect them to the sign-up page with an appropriate message.
[ ] Block login attempts for users that do not have an account.
[ ] Provide a link to the sign-up page.
[ ] Add unit tests to ensure the proper flow for new customers attempting to log in.
Additional Notes
Ensure that existing customers are unaffected by this change and can log in as usual.
Handle cases where email lookup might fail, with appropriate error messages.
Consider adding this flow as part of the broader user authentication process.
Issue: Redirect New Customers to Sign in Instead of Login
Description
New customers should not be able to log in directly, as they do not yet have an account. Instead of allowing login attempts from new users, they should be redirected to the sign-up page to create an account. This will prevent confusion and improve the user experience.
Requirements
Expected Behavior
Tasks
Additional Notes