earthowned / planetfarms

GNU Affero General Public License v3.0
5 stars 8 forks source link

Use email as username #516

Closed neil-sweetcodepro closed 2 years ago

neil-sweetcodepro commented 2 years ago
  1. Use email as user's username
  2. Change req.body.name to use req.body.username for consistency across endpoints.
neil-sweetcodepro commented 2 years ago

To be reviewed and merged after https://github.com/earthowned/planetfarms/pull/514

lmmrssa commented 2 years ago

Along with issues mentioned on other PR.

  1. When testing for forgot password it does not seem to work. Give code warning
  2. When trying to register new user, only email is allowed but there is no screen for verifying email address. So it gives invalid token error
neil-sweetcodepro commented 2 years ago

@lmmrssa we'll be forced to use emails for new users in registration. You won't be able to log in and confirm the code using the frontend. There will be frontend changes to follow after this PR.

neil-sweetcodepro commented 2 years ago

@lmmrssa fixed issue 4. In order to confirm/verify email address, send request directly to the backend. Make a request to /api/users/confirm-sign-up endpoint with the sample json payload:

{
    "username": "test@test.com",
    "code": "666704"
}

To resend the sign up code, make a request to POST /api/users/resend-sign-up-code with the sample json payload:

{
  "username": "test@test.com"
}