Closed BethanyG closed 4 years ago
:exclamation: No coverage uploaded for pull request base (
main@6f9a92f
). Click here to learn what that means. The diff coverage isn/a
.
@@ 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.
Legend - Click here to learn more
Ξ = absolute <relative> (impact)
,ΓΈ = not affected
,? = missing data
Powered by Codecov. Last update 6f9a92f...604bac8. Read the comment docs.
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: project/core/templates/account/email/email _confirmation_subject.txt
has an extra space near the underscore.
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.
OK. I think I've fixed both the intermittent test failure and the mis-named file. Test are passing.
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?