You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, once again, thanks for the great work put into this package, I think it is really neat.
So, I'd like my users to be able to change their registered email, but I want to verify their new email account before the change takes place. One way I figured I could do that was by saving the requested new email in a different field (say, new_email), then send a verification link to that new address, and have the callback just do user.email = user.new_email in case the user is_active and has the new_email field set. The issue is that send_email only allows me to send emails to user.email.
I think there is an easy fix for this that doesn't break existing code. It would just require changing the signature of send_email from:
(of course, the new address parameter would need to be propagated to send_inner_thread).
That way send_email(user) and send_email(user, address=user.new_email) would both work.
Do you think that this is possible/desirable? If so, would you like me to do a PR or would you prefer to change it yourself?
The text was updated successfully, but these errors were encountered:
Edit: From what I understand, the solution I proposed would not require changing the payload in the token generator, but the email field would still need to be set for the user, with the old value, when the email is sent.
Maybe instead of modifying the signature of send_email one could provide a new function send_change_email (or something like that) to make the API clearer.
Another possibility would be to provide the name of the field in the user model to send the email to, but that sounds like it should be done with a setting (and require a change in the payload), and would not fit my use case.
Hello, once again, thanks for the great work put into this package, I think it is really neat.
So, I'd like my users to be able to change their registered email, but I want to verify their new email account before the change takes place. One way I figured I could do that was by saving the requested new email in a different field (say,
new_email
), then send a verification link to that new address, and have the callback just douser.email = user.new_email
in case the useris_active
and has thenew_email
field set. The issue is thatsend_email
only allows me to send emails touser.email
.I think there is an easy fix for this that doesn't break existing code. It would just require changing the signature of
send_email
from:to:
and then in
send_inner_thread
changing the line:to:
(of course, the new
address
parameter would need to be propagated tosend_inner_thread
).That way
send_email(user)
andsend_email(user, address=user.new_email)
would both work.Do you think that this is possible/desirable? If so, would you like me to do a PR or would you prefer to change it yourself?
The text was updated successfully, but these errors were encountered: