Skip to content

Commit

Permalink
馃拕 [#26] Added templates for the authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
ErhanCitil committed Feb 16, 2024
1 parent 542ea73 commit f3cbaa2
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/bobvance/login/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
urlpatterns = [
path('login/', auth_views.LoginView.as_view(), name='login'),
path('logout/', auth_views.LogoutView.as_view(), name='logout'),
path('password_reset/', auth_views.PasswordResetView.as_view(), name='password_reset'),
path('reset/<uidb64>/<token>/', auth_views.PasswordResetConfirmView.as_view(), name='password_reset_confirm'),
path('password_reset/done/', auth_views.PasswordResetDoneView.as_view(), name='password_reset_done'),
path('password_reset/', auth_views.PasswordResetView.as_view(template_name='registration/password_reset.html'), name='password_reset'),
path('reset/<uidb64>/<token>/', auth_views.PasswordResetConfirmView.as_view(template_name='registration/password_reset_confirm.html'), name='password_reset_confirm'),
path('password_reset/done/', auth_views.PasswordResetDoneView.as_view(template_name='registration/password_reset_done.html'), name='password_reset_done'),
]
19 changes: 19 additions & 0 deletions src/bobvance/templates/registration/password_reset.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{% extends "master.html" %}

{% block content %}

{% if form.errors %}
<p>There was an error with the submitted form. Please correct the errors and try again.</p>
{% endif %}

<h2>Password Reset</h2>

<form method="post" action="{% url 'password_reset' %}">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Reset Password</button>
</form>

<p>Remembered your password? <a href="{% url 'login' %}">Log in</a></p>

{% endblock %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{% extends "master.html" %}

{% block content %}

{% if valid %}
<h2>Password Reset Successful</h2>
<p>Your password has been successfully reset.</p>
<p><a href="{% url 'login' %}">Log in</a></p>
{% else %}
<h2>Password Reset Failed</h2>
<p>The password reset link is no longer valid. Please request a new one.</p>
<p><a href="{% url 'password_reset' %}">Request a new password reset</a></p>
{% endif %}

{% endblock %}
11 changes: 11 additions & 0 deletions src/bobvance/templates/registration/password_reset_done.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{% extends "master.html" %}

{% block content %}

<h2>Password Reset Email Sent</h2>
<p>We've sent you an email with instructions on how to reset your password.
If you don't receive an email within a few minutes, check your spam folder.</p>

<p><a href="{% url 'login' %}">Return to login page</a></p>

{% endblock %}

0 comments on commit f3cbaa2

Please sign in to comment.