-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #584 from memeLab/refactor-reset-password
Refactor reset password to use default django auth process
- Loading branch information
Showing
23 changed files
with
227 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,8 @@ POSTGRES_PASSWORD=secret | |
# Email server variables | ||
SMTP_SERVER=mailpit | ||
SMTP_PORT=1025 | ||
SMTP_USE_TLS=False | ||
SMTP_USE_SSL=False | ||
SMTP_USER= | ||
SMTP_PASSWORD= | ||
SMTP_SENDER_MAIL="[email protected]" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
from django.utils.translation import gettext_lazy as _ | ||
from sentry_sdk.integrations.django import DjangoIntegration | ||
|
||
from .storage_settings import * # noqa F403 F401 | ||
from .storage_settings import * # noqa F403 F401 | ||
|
||
ROOT_DIR = environ.Path("/jandig/") | ||
BASE_DIR = "/jandig/src" | ||
|
@@ -194,11 +194,15 @@ def debug(request): | |
# Sphinx docs | ||
DOCS_ROOT = "/jandig/build/" | ||
|
||
SMTP_SERVER = env("SMTP_SERVER", default="mailpit") | ||
SMTP_PORT = env("SMTP_PORT", default=1025) | ||
SMTP_USER = env("SMTP_USER", default="[email protected]") | ||
SMTP_PASSWORD = env("SMTP_PASSWORD", default="password") | ||
SMTP_SENDER_MAIL = env("SMTP_SENDER_MAIL", default="[email protected]") | ||
|
||
DEFAULT_FROM_EMAIL = env("SMTP_SENDER_MAIL", default="[email protected]") | ||
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend" | ||
EMAIL_HOST = env("SMTP_SERVER", default="mailpit") | ||
EMAIL_USE_TLS = env("SMTP_USE_TLS", default=False) | ||
EMAIL_PORT = env("SMTP_PORT", default=1025) | ||
EMAIL_HOST_USER = env("SMTP_USER", default="[email protected]") | ||
EMAIL_HOST_PASSWORD = env("SMTP_PASSWORD", default="password") | ||
EMAIL_USE_SSL = False | ||
|
||
# Recaptcha | ||
RECAPTCHA_ENABLED = env("RECAPTCHA_ENABLED", default=False) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
59 changes: 59 additions & 0 deletions
59
src/users/jinja2/users/reset-password/password_reset.jinja2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{% extends '/core/arviewer.jinja2' %} | ||
{% block content %} | ||
<div class="form-content my-3 p-3"> | ||
<div class="container"> | ||
<div class="row justify-content-center"> | ||
<div class="col-lg-5"> | ||
<div class="card shadow-lg border-0 rounded-lg mt-0 mb-3"> | ||
<div class="card-header justify-content-center"> | ||
<div id="error_div"></div> | ||
<h3 class="font-weight-light my-4 text-center">Forgot Password?</h3> | ||
</div> | ||
{% if form.errors %} | ||
<div class="alert alert-danger alert-dismissible" role="alert"> | ||
<div id="form_errors"> | ||
{% for key, value in form.errors.items %} | ||
<strong>{{ value }}</strong> | ||
{% endfor %} | ||
</div> | ||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
</div> | ||
{% endif %} | ||
<div class="card-body"> | ||
<form method="POST"> | ||
{{ csrf_input }} | ||
<div class="form-row"> | ||
<div class="col-md-10 offset-md-1"> | ||
<div class="form-group"> | ||
<label class="small mb-1" for="id_email">Email</label> | ||
<input type="email" name="email" class="form-control" | ||
autocomplete="email" maxlength="254" required id="id_email" | ||
placeholder="Enter email"> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="form-row"> | ||
<div class="col-md-10 offset-md-1"> | ||
<div class="form-group mt-0 mb-1"> | ||
<button type="submit" class="col-md-12 btn btn-dark">Submit | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
<div class="card-footer text-center"> | ||
<div class="small"> | ||
<a href="{{ url('signup') }}">Create A New Account</a><br><br> | ||
<a href="{{ url('login') }}">Back To Login</a><br> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
{% endblock content %} |
15 changes: 15 additions & 0 deletions
15
src/users/jinja2/users/reset-password/password_reset_complete.jinja2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{% extends '/core/arviewer.jinja2' %} | ||
{% block title %} Password Reset {% endblock title%} | ||
{% block content %} | ||
<div class="container my-3 p-3"> | ||
<div class="row justify-content-center"> | ||
<div class="col-lg-5"> | ||
<div class="card shadow-lg border-0 rounded-lg mt-0 mb-3"> | ||
<div class="alert alert-info"> | ||
Your password has been set. You may go ahead and <a href="{{ url('login') }}">Login Here</a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock content %} |
Oops, something went wrong.