-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Email verification #3405
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
Email verification #3405
Conversation
A couple of thoughts:
|
@dcramer ok, do you think it's a better idea to just hold off on this then? or just make it more flexible by making a separate model that isn't tied to the user (or at least doesn't have a unique constraint on the user)? |
@macqueen yeah I think it'd be best to get both birds here, and probably just have like an Email model (or LinkedEmail or something similar). Effectively we want to take a similar approach to how GitHub does email validation. I do think we can at least reuse some of the password code (even if we copy paste it). |
e6fff74
to
0a52c77
Compare
@macqueen Looks good! I think I would try the .narrow or .auth body classes for this template. I'd also do something like |
Woah, just now noticing that sweet 'fi' ligature. @macqueen I think this is much better. Two final suggestions:
|
😍 |
0b7007f
to
ce9da3e
Compare
@dcramer and/or @mattrobenolt do you have any other suggestions/feedback? |
src/sentry/models/email.py
Outdated
|
||
|
||
class Email(Model): | ||
__core__ = True |
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.
This isn't needed. The default is implied True
.
6a551f7
to
ee5d87b
Compare
I think this is ready to merge unless anyone has any other suggestions. |
src/sentry/models/useremail.py
Outdated
|
||
def set_hash(self): | ||
self.date_hash_added = timezone.now() | ||
characters = u'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' |
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.
would be worthwhile to define this at module level rather than here
0c73ac7
to
88ab53d
Compare
} | ||
msg = MessageBuilder( | ||
subject='%sConfirm Email' % (options.get('mail.subject-prefix'),), | ||
template='sentry/emails/confirm_email.txt', |
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.
Add type='user.confirm_email',
below this line to get sweet sweet mail.{queued,sent}
logging events.
If you run tests and they wig out or something doesn't work, rebasing off of origin/master
will fix it.
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.
done. thanks!
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.
👍
88ab53d
to
cf2255e
Compare
get initial email verification flow working add user is_verified field add tests for email verification flow linting, a few tweaks to make workflow smoother fix bug where verification email went to old email when user changed email address remove unnecessary change use a separate email model to make validation more flexible fix tests and migrations ui pr feedback, get rid of race condition when creating new email models ui/header feedback matt's pr feedback use signals to create user email model (instead of save method) add type to MessageBuilder
cf2255e
to
9d3bd32
Compare
Not super fancy -- just based it on how we do password reset.
@ckj let me know if you have suggestions for making pages with very little text look less silly.
@ehfeng @getsentry/python