Commit 58f13628 authored by Samuel GAIST's avatar Samuel GAIST

[ui] Implement password reset

parent ee45f7d3
Pipeline #28266 passed with stage
in 17 minutes and 35 seconds
......@@ -2,21 +2,21 @@
{% comment %}
* Copyright (c) 2016 Idiap Research Institute, http://www.idiap.ch/
* Contact: beat.support@idiap.ch
*
*
* This file is part of the beat.web module of the BEAT platform.
*
*
* Commercial License Usage
* Licensees holding valid commercial BEAT licenses may use this file in
* accordance with the terms contained in a written agreement between you
* and Idiap. For further information contact tto@idiap.ch
*
*
* Alternatively, this file may be used under the terms of the GNU Affero
* Public License version 3 as published by the Free Software and appearing
* in the file LICENSE.AGPL included in the packaging of this file.
* The BEAT platform is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE.
*
*
* You should have received a copy of the GNU Affero Public License along
* with the BEAT platform. If not, see http://www.gnu.org/licenses/.
{% endcomment %}
......@@ -65,6 +65,8 @@
<p class="comment">In order to sign in, you must be <a href="{% url 'registration' %}">registered</a></p>
<p class="comment">Inactive/Blocked user need to get their account reactivated <a href="{% url 'blocked_user_reactivation' %}">reactivation</a></p>
<p class="comment">Forgot your password ? <a href="{% url 'password_reset' %}">Reset password</a></p>
</div>
</div>
......
{% extends "base.html" %}
{% comment %}
* Copyright (c) 2019 Idiap Research Institute, http://www.idiap.ch/
* Contact: beat.support@idiap.ch
*
* This file is part of the beat.web module of the BEAT platform.
*
* Commercial License Usage
* Licensees holding valid commercial BEAT licenses may use this file in
* accordance with the terms contained in a written agreement between you
* and Idiap. For further information contact tto@idiap.ch
*
* Alternatively, this file may be used under the terms of the GNU Affero
* Public License version 3 as published by the Free Software and appearing
* in the file LICENSE.AGPL included in the packaging of this file.
* The BEAT platform is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero Public License along
* with the BEAT platform. If not, see http://www.gnu.org/licenses/.
{% endcomment %}
{% load i18n static %}
{% load registration_tags %}
{% block content %}
<div class="row">
<div class="col-sm-4 col-sm-offset-4">
<div class="panel panel-default login-panel">
<div class="panel-heading">Password reset</div>
<div class="panel-body">
<p>{% trans "Your password has been set. You may go ahead and log in now." %}</p>
<p><a href="{{ login_url }}">{% trans 'Log in' %}</a></p>
</div>
</div>
</div>
</div>
{% endblock content %}
{% extends "base.html" %}
{% comment %}
* Copyright (c) 2019 Idiap Research Institute, http://www.idiap.ch/
* Contact: beat.support@idiap.ch
*
* This file is part of the beat.web module of the BEAT platform.
*
* Commercial License Usage
* Licensees holding valid commercial BEAT licenses may use this file in
* accordance with the terms contained in a written agreement between you
* and Idiap. For further information contact tto@idiap.ch
*
* Alternatively, this file may be used under the terms of the GNU Affero
* Public License version 3 as published by the Free Software and appearing
* in the file LICENSE.AGPL included in the packaging of this file.
* The BEAT platform is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero Public License along
* with the BEAT platform. If not, see http://www.gnu.org/licenses/.
{% endcomment %}
{% load i18n static %}
{% load registration_tags %}
{% block content %}
<div class="row">
<div class="col-sm-4 col-sm-offset-4">
<div class="panel panel-default login-panel">
<div class="panel-heading">Password reset</div>
<div class="panel-body">
{% if validlink %}
<p>{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}</p>
<form method="post" class="form">
{% csrf_token %}
<div class="form-group field-password1">
<label for="id_new_password1">{% trans 'New password:' %}</label>
{{ form.new_password1|tabindex:1|addclass:"form-control" }}
{{ form.new_password1.errors }}
</div>
<div class="form-group field-password2">
<label for="id_new_password2">{% trans 'Confirm password:' %}</label>
{{ form.new_password2|tabindex:1|addclass:"form-control" }}
{{ form.new_password2.errors }}
</div>
<div class="form-group">
<button type="submit" class="btn btn-success" tabindex="3"><i class="fa fa-sign-in fa-fw fa-lg"></i> {% trans 'Change my password' %}</button>
</div>
</form>
{% else %}
<p>{% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %}</p>
{% endif %}
</div>
</div>
</div>
</div>
{% endblock content %}
{% extends "base.html" %}
{% comment %}
* Copyright (c) 2019 Idiap Research Institute, http://www.idiap.ch/
* Contact: beat.support@idiap.ch
*
* This file is part of the beat.web module of the BEAT platform.
*
* Commercial License Usage
* Licensees holding valid commercial BEAT licenses may use this file in
* accordance with the terms contained in a written agreement between you
* and Idiap. For further information contact tto@idiap.ch
*
* Alternatively, this file may be used under the terms of the GNU Affero
* Public License version 3 as published by the Free Software and appearing
* in the file LICENSE.AGPL included in the packaging of this file.
* The BEAT platform is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero Public License along
* with the BEAT platform. If not, see http://www.gnu.org/licenses/.
{% endcomment %}
{% load i18n static %}
{% load registration_tags %}
{% block content %}
<div class="row">
<div class="col-sm-4 col-sm-offset-4">
<div class="panel panel-default login-panel">
<div class="panel-heading">Password reset</div>
<div class="panel-body">
<p>{% trans "We've emailed you instructions for setting your password, if an account exists with the email you entered. You should receive them shortly." %}</p>
<p>{% trans "If you don't receive an email, please make sure you've entered the address you registered with, and check your spam folder." %}</p>
</div>
</div>
</div>
</div>
{% endblock content %}
{% extends "base.html" %}
{% comment %}
* Copyright (c) 2019 Idiap Research Institute, http://www.idiap.ch/
* Contact: beat.support@idiap.ch
*
* This file is part of the beat.web module of the BEAT platform.
*
* Commercial License Usage
* Licensees holding valid commercial BEAT licenses may use this file in
* accordance with the terms contained in a written agreement between you
* and Idiap. For further information contact tto@idiap.ch
*
* Alternatively, this file may be used under the terms of the GNU Affero
* Public License version 3 as published by the Free Software and appearing
* in the file LICENSE.AGPL included in the packaging of this file.
* The BEAT platform is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero Public License along
* with the BEAT platform. If not, see http://www.gnu.org/licenses/.
{% endcomment %}
{% load i18n static %}
{% load registration_tags %}
{% block content %}
<div class="row">
<div class="col-sm-4 col-sm-offset-4">
<div class="panel panel-default login-panel">
<div class="panel-heading">Password reset</div>
<div class="panel-body">
<form method="post" action="" class="form">
{% csrf_token %}
{% csrf_token %}
{{ form.as_p }}
<button type="submit" class="btn btn-success" tabindex="3"><i class="fa fa-sign-in fa-fw fa-lg"></i> Send me instructions !</button>
</form>
</div>
</div>
</div>
</div>
{% endblock content %}
......@@ -28,7 +28,7 @@
from django.conf.urls import url
from django.conf import settings
from django.views.generic.base import TemplateView
from django.contrib.auth.views import logout
from django.contrib.auth import views as auth_views
from . import views
......@@ -37,76 +37,87 @@ from .registration.views import register
from .registration.forms import PreregistrationForm
urlpatterns = [
url(r'^$',
views.index,
name='index',
),
url(r'^login/$',
views.login,
name='login',
),
url(r'^blocked_user_reactivation/$',
url(r"^$", views.index, name="index"),
url(r"^login/$", views.login, name="login"),
url(
r"^blocked_user_reactivation/$",
views.blocked_user_reactivation,
name='blocked_user_reactivation',
),
url(r'^events/(?P<author_name>\w+)/$',
views.activity_stream,
name='activity-stream',
name="blocked_user_reactivation",
),
url(r'^logout/$',
logout,
{'next_page': 'index'},
name='logout',
),
url(r'^docreq/(?P<author_name>\w+)/$',
views.docreq,
name='docreq',
),
url(
r"^events/(?P<author_name>\w+)/$", views.activity_stream, name="activity-stream"
),
url(r"^logout/$", auth_views.logout, {"next_page": "index"}, name="logout"),
url(r"^docreq/(?P<author_name>\w+)/$", views.docreq, name="docreq"),
# Activation keys get matched by \w+ instead of the more specific
# [a-fA-F0-9]{40} because a bad activation key should still get to the
# view; that way it can return a sensible "invalid key" message instead
# of a confusing 404.
url(r'^signup/$', register,
dict(success_url='registration-complete'),
name='registration',
),
url(r'^signup/complete/$',
url(
r"^signup/$",
register,
dict(success_url="registration-complete"),
name="registration",
),
url(
r"^signup/complete/$",
TemplateView.as_view(
template_name=('registration/registration_pending.html' if \
settings.PREREGISTRATION_ONLY else \
'registration/registration_complete.html')
),
name='registration-complete',
template_name=(
"registration/registration_pending.html"
if settings.PREREGISTRATION_ONLY
else "registration/registration_complete.html"
)
),
url(r'^signup/activate/(?P<activation_key>\w+)/$',
name="registration-complete",
),
url(
r"^signup/activate/(?P<activation_key>\w+)/$",
activate,
name='registration-activation',
),
url(r'^preregister/$',
name="registration-activation",
),
url(
r"^preregister/$",
register,
dict(
success_url='pre-registration-complete',
form_class= PreregistrationForm,
template_name='registration/preregistration_form.html',
success_url="pre-registration-complete",
form_class=PreregistrationForm,
template_name="registration/preregistration_form.html",
),
name='pre-registration'
),
url(r'^preregistration/complete/$',
name="pre-registration",
),
url(
r"^preregistration/complete/$",
TemplateView.as_view(
template_name='registration/preregistration_complete.html',
template_name="registration/preregistration_complete.html"
),
name='pre-registration-complete',
name="pre-registration-complete",
),
url(
r"^password_reset/$",
auth_views.PasswordResetView.as_view(
template_name="registration/password-reset-form.html"
),
name="password_reset",
),
url(
r"^password_reset/done/$",
auth_views.PasswordResetDoneView.as_view(
template_name="registration/password-reset-done.html"
),
name="password_reset_done",
),
url(
r"^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$",
auth_views.PasswordResetConfirmView.as_view(
template_name="registration/password-reset-confirm.html"
),
name="password_reset_confirm",
),
url(
r"^reset/done/$",
auth_views.PasswordResetCompleteView.as_view(
template_name="registration/password-reset-complete.html"
),
name="password_reset_complete",
),
]
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