-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add email verification #198
Conversation
lkeegan
commented
Dec 5, 2024
- docker-compose
- add postfix image
- backend
- add SMTP_HOST to settings
- send user an email with a verification link when they sign up
- frontend
- add /verify route
- resolves add email to backend #109
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #198 +/- ##
==========================================
+ Coverage 29.86% 30.14% +0.27%
==========================================
Files 104 105 +1
Lines 3422 3440 +18
Branches 92 93 +1
==========================================
+ Hits 1022 1037 +15
- Misses 2323 2325 +2
- Partials 77 78 +1 ☔ View full report in Codecov by Sentry. |
- docker-compose - add postfix image - backend - add SMTP_HOST to settings - send user an email with a verification link when they sign up - frontend - add /verify/[[code]] route - shows message & login page if verification successful, or account is already verified - shows error message otherwise - resolves #109
a681016
to
3a6964c
Compare
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.
lgtm, thanks for doing this. Have 3 little questions regarding code which are more for clarification. I didn´t get it to work locally though to try it out.
Edit: works with iwr address, but not with google? I also got a 404 when clicking on the link provided, but could log in anyway after that?
msg["To"] = email | ||
msg["Subject"] = "MONDEY-Konto aktivieren" | ||
msg.set_content( | ||
f"Bitte klicken Sie hier, um Ihr MONDEY-Konto zu aktivieren:\n\nhttps://mondey.lkeegan.dev/verify/{token}" |
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.
should this be localized in some way or contain an english translation?
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.
I guess so, I'd go with including an english translation in the email to keep this simple
return SMTPMock | ||
|
||
|
||
def test_register_new_user(public_client: TestClient, smtp_mock: SMTPMock): |
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.
do we need a test for failed verification?
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.
yes true, will add one
Yes google are quite aggressive in blocking unknown / potentially spam domains. We'll have to see if it works when sending from mondey.de or if we need an email account or maybe sign up for a mail sending service. The link should work if you replace mondey.lkeegan.dev with localhost in the url when running locally? |
…ct verify calls in tests
Quality Gate passedIssues Measures |