diff --git a/nexong/api/Authentication/views.py b/nexong/api/Authentication/views.py index 1a09024..dad8a25 100644 --- a/nexong/api/Authentication/views.py +++ b/nexong/api/Authentication/views.py @@ -159,7 +159,7 @@ def get(self, request, *args, **kwargs): user.is_enabled = True user.is_active = True user.save() - return redirect(reverse("activation_success")) + return redirect("http://127.0.0.1:3000/iniciar-sesion/") else: return Response( {"detail": "Token not valid"}, diff --git a/nexong/email.py b/nexong/email.py new file mode 100644 index 0000000..be24ee5 --- /dev/null +++ b/nexong/email.py @@ -0,0 +1,5 @@ +from djoser import email + + +class ActivationEmail(email.ActivationEmail): + template_name = "account/activation.html" diff --git a/nexong/templates/account/activation.html b/nexong/templates/account/activation.html new file mode 100644 index 0000000..322c7bf --- /dev/null +++ b/nexong/templates/account/activation.html @@ -0,0 +1,15 @@ +{% load i18n %} + +{% block subject %} +{% blocktrans %}Activación de cuenta en {{ site_name }}{% endblocktrans %} +{% endblock subject %} + + +{% block html_body %} +

{% blocktrans %} +Estás recibiendo este correo porque necesitas finalizar el proceso de activación de tu cuenta en {{ protocol }}://{{ domain }}/{{ url|safe }} +{% endblocktrans %}

+

Al pulsar el botón, se activará su cuenta y será redirigido a la página de inicio de sesión:

+

Activar cuenta

+ +{% endblock html_body %} diff --git a/src/settings.py b/src/settings.py index c4a6894..d346833 100644 --- a/src/settings.py +++ b/src/settings.py @@ -195,6 +195,9 @@ }, "SOCIAL_AUTH_TOKEN_STRATEGY": "djoser.social.token.jwt.TokenStrategy", "SOCIAL_AUTH_ALLOWED_REDIRECT_URIS": white_list, + "EMAIL": { + "activation": "nexong.email.ActivationEmail", + }, } SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = config("GOOGLE_OAUTH2_KEY")