Commit 54bc1fe4 authored by Krzysztof Jura's avatar Krzysztof Jura Committed by Linus Lewandowski

Added log_in to be possible to add in welcome-back template

parent b70202a8
......@@ -6,6 +6,9 @@ from six.moves.urllib.parse import urlencode
from ..token import auth_token
def login_link(email):
token = auth_token(email)
return settings.BASE_HOST + reverse('extauth:login-by-email', args=[token])
def password_reset_link(site, email, user, **kwargs):
url = reverse('extauth:settings', args=[user.id])
......
......@@ -6,7 +6,7 @@ from django.utils.translation import gettext_lazy as _
from django_sendmail import send_mail
from ..models import ExternalIdentity, create_user
from .auth_links import finish_registration_by_email_link, password_reset_link
from .auth_links import finish_registration_by_email_link, password_reset_link, login_link
class AuthRegisterForm(forms.Form):
......@@ -61,6 +61,7 @@ class AuthRegisterForm(forms.Form):
send_mail(ei.email, 'registration/email/welcome-back', {
'user': ei.user,
'reset_password': password_reset_link(site, ei.email, ei.user, **query),
'log_in': login_link(ei.email),
}, request=request)
else:
send_mail(ei.email, 'registration/email/welcome-back', {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment