mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
email: Add reset button to password reset email.
This commit is contained in:
@@ -224,7 +224,6 @@ class ZulipPasswordResetForm(PasswordResetForm):
|
||||
'email': email,
|
||||
'realm_uri': realm.uri,
|
||||
'user': user,
|
||||
'protocol': 'https' if use_https else 'http',
|
||||
}
|
||||
|
||||
if user is not None and user_matches_subdomain(subdomain, user):
|
||||
@@ -232,6 +231,11 @@ class ZulipPasswordResetForm(PasswordResetForm):
|
||||
context['token'] = token_generator.make_token(user)
|
||||
context['uid'] = urlsafe_base64_encode(force_bytes(user.id))
|
||||
|
||||
protocol = 'https' if use_https else 'http'
|
||||
endpoint = reverse('django.contrib.auth.views.password_reset_confirm',
|
||||
kwargs=dict(uidb64=context['uid'], token=context['token']))
|
||||
context['reset_url'] = "{}://{}{}".format(protocol, user.realm.host, endpoint)
|
||||
|
||||
send_email('zerver/emails/password_reset', to_user_id=user.id,
|
||||
from_name="Zulip Account Security",
|
||||
from_address=FromAddress.NOREPLY, context=context)
|
||||
|
||||
Reference in New Issue
Block a user