Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update user registration flow to support new backend auth endpoints #161

Open
lpatmo opened this issue Sep 26, 2020 · 15 comments
Open

Update user registration flow to support new backend auth endpoints #161

lpatmo opened this issue Sep 26, 2020 · 15 comments
Assignees
Labels

Comments

@lpatmo
Copy link
Member

lpatmo commented Sep 26, 2020

Context

Note: work on this issue after codebuddies/backend#187 is merged in. That PR rewrote the auth to use a more up-to-date auth package that supports email verification, an important step we didn't support before.

First, let me try registering a new user:
POST /api/v1/auth/registration/
{
"username": "linda",
"email": "[email protected]",
"password1": "uniquepassword",
"password2": "uniquepassword"
}

I'll get a 201 Response:
{
"detail": "Verification e-mail sent."
}

image

If I login without verifying the email, I'll get the following 400 response:
POST /api/v1/auth/login/
{
"username": "",
"email": "",
"password": ""
}

HTTP 400 Bad Request
Allow: POST, OPTIONS
Content-Type: application/json
Vary: Accept

{
"non_field_errors": [
"E-mail is not verified."
]
}

When the verification email is sent, it'll contain a link that looks something like:
http://localhost:8000/api/v1/auth/registration/verify-email/?key=

On the FE app, we'll need to create a page with the route /api/v1/auth/registration/verify-email/?key=

and make a POST request sending the key:

POST /api/v1/auth/registration/verify-email/
{
"key":
}

This will validate the email address.

Source: codebuddies/backend#191

How to log out:
POST api/v1/auth/logout

How to view the details of a currently-logged-in user
GET api/v1/auth/user
image

GET api/v1/auth/current_user //without email address
image

Acceptance criteria

[ ] Update the POST request when a user registers to hit POST /api/v1/auth/registration/
[ ] Remove the first name and last name fields
[ ] Change the login endpoint to be POST /api/v1/auth/login/
[ ] Change the logout endpoint to be POST api/v1/auth/logout
[ ] Create a api/v1/auth/registration/verify-email?key={KEY} page that upon load, makes a POST request to /verify-email and passes in the key from the params in the URL

POST /api/v1/auth/registration/verify-email/
{
    "key": <KEY>
}
@peoray peoray self-assigned this Oct 5, 2020
@peoray
Copy link
Member

peoray commented Oct 5, 2020

PR has been merged. Is this available?

@lpatmo
Copy link
Member Author

lpatmo commented Oct 5, 2020

@peoray Here's a rough draft of the PR: #163

This will need to be rebased when the folder restructuring happens, though! In the meantime, feel free to poke around the branch from that draft PR. :) Let me know if you have questions!

@stale
Copy link

stale bot commented Nov 4, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 4, 2020
@stale stale bot closed this as completed Nov 11, 2020
@lpatmo lpatmo reopened this Nov 11, 2020
@stale stale bot removed the stale label Nov 11, 2020
@pdotsani
Copy link
Contributor

Is this still available? Not sure if @peoray still wanted to take it.

@peoray
Copy link
Member

peoray commented Nov 11, 2020

@pdotsani Yeah, I'm still active on this. If you want, we can pair and work on it together

@pdotsani
Copy link
Contributor

Sounds good! Are you on slack? I think I pinged you...

@stale
Copy link

stale bot commented Dec 11, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 11, 2020
@BethanyG
Copy link
Member

@peoray @pdotsani -- is this still in progress, or should we be closing it? Pls LMK. Thanks!

@stale stale bot removed the stale label Dec 11, 2020
@pdotsani
Copy link
Contributor

Hi @BethanyG - It's still in progress. @peoray and I are about halfway done. We're planing to work on it next weekend.

@stale
Copy link

stale bot commented Jan 11, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 11, 2021
@stale stale bot closed this as completed Jan 18, 2021
@BethanyG
Copy link
Member

@pdotsani -- the stale bot has come for this again. I think commenting on it will be sufficient to keep it open....but thought I'd ping you just in case.

@pdotsani
Copy link
Contributor

@BethanyG 👍

@BethanyG
Copy link
Member

Actually, it closed it. 😢 Reopening.

@BethanyG BethanyG reopened this Jan 18, 2021
@angelocordon
Copy link
Contributor

Isn't there a tag we can use that makes stalebot ignore issues?

@BethanyG
Copy link
Member

@angelocordon - maybe - If there is, I don't have time at the moment to find it. For the backend, we review and then remove the stale flag for issues that get marked stale. I only noticed this for frontend because I got a note it was closed b/c its linked to a backend issue I was working on.

@stale stale bot removed the stale label Jan 18, 2021
@lpatmo lpatmo added the pinned label Jan 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants