-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Dj rest auth #187
Dj rest auth #187
Conversation
β¦llauth together.
β¦est-auth settings.
β¦rm emails and password reset.
β¦gin, logout, and user details. Reorganized.
Codecov Report
@@ Coverage Diff @@
## main #187 +/- ##
=======================================
Coverage ? 81.56%
=======================================
Files ? 33
Lines ? 548
Branches ? 0
=======================================
Hits ? 447
Misses ? 101
Partials ? 0 Continue to review full report at Codecov.
|
Yay!!! πππ Excellent work, Bethany! I started reviewing this morning but didn't get a chance to finish testing and looking at everything, but will try to finish up tonight/tomorrow. One small detail that can be fixed right now: |
Hey @lpatmo - thanks for the sharp-eyed copyedit! Could you make that suggestion in the PR directly, so we can just accept it here -- or give me a file and line to reference? Not sure where the URL is is mis-typed? Thanks! EDIT: NM! Found it. Will push a renamed file. oooofh. Not sure why, but changing that file causes 17 test failures and an endless recursion. Reverting. |
β¦name." This reverts commit 2670780. This file rename breaks allauth and all auth test cases for some reason. It also causes a python failure due to an endless import recursion. Not sure why/how this came about, but the easiest thing is to leave it as-is, and revert the change.
β¦ updating settings and tests.
β¦es, it will fail intermittently - not consistantly.
β¦ to exclude extra space.
OK. I think I've fixed both the intermittent test failure and the mis-named file. Test are passing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I think I've fixed both the intermittent test failure and the mis-named file. Test are passing.
Yay, thanks for fixing!
TIL having EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
means the email is "sent" via stdout if I run docker-compose up
without the -d
flag :D
We may need to look into updating the "from" line (a future issue), but I'm very happy with this:
Again, thanks for this big chunk of work! π Feel free to merge in when you're ready. Separately, I filed a FE ticket to look into the changes that need to be made on the FE side: codebuddies/frontend#161
project/core/templates/account/email/email _confirmation_subject.txt
Outdated
Show resolved
Hide resolved
Co-authored-by: Linda <linda.peng@alumni.duke.edu>
OK. Mashing the big, green button. π |
What type of PR is this? (check all applicable)
Context
We wanted to implement a user registration process that incorporated an email and verification of that email.
See issue #110 and discussion #178 for additional context.
Closes #110, #113, #114, #118
Other Related Tickets & Documents (as needed)
Implementation Details
We had originally planned to use django-rest-auth, but it is no longer maintained, and doesn't play nice with
django-allauth
anymore.dj-rest-auth
is the currently maintained fork ofdjango-rest-auth
. However,dj-rest-auth
requires the django-simpleJWT library, so the currentdjango-rest-framework-jwt
library was replaced.It was also decided that authorization and registration should live under the main API url instead of being "off to the side", so the URLs and code were refactored to support this. Additionally, settings changes were made to require a validated email upon user registration. Users will no longer be allowed to login without a "verified" email.
More refactor/changes may be needed as we refine user profiles and permissions.
Obtaining JWT tokens has moved to:
api/v1/auth/token
(obtain an access and refresh token pair),api/v1/auth/verify
(verify the validity of a refresh or access token),api/v1/refresh
(obtain new access toke by using non-expired refresh token)Registration/Login/Logout are now located at:
api/v1/auth/registration/
(now triggers a validation email to the email address a user enters.)api/v1/auth/verify-email/
(to POST a user's HMC email key for validating their email)api/v1/auth/login/
(Will require a validated email in order to sign in)api/v1/auth/logout/
(Will clear tokens from currently logged in user)User Details and current_user are located at:
api/v1/auth/user/
(to view currently logged in User Details)api/v1/auth/current_user
(to view currently logged in User without email address)Since these two are redundant, one may be omitted or changed later in the project.
New Libraries/Dependancies Introduced (Fill out as needed)
If you have added libraries or other dependancies, please list them (and links to their repos) below:
djangorestframework-simplejwt
dj-rest-auth==1.1.1
django-rest-authtoken==2.1.3
project/requirements/base.txt
Any new migration files added?
Did you add tests?
Code added or changed without test coverage or good reason for exemption won't be approved.
Did you add documentation?