Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nopaque
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SFB 1288 - INF
nopaque
Commits
1a973bfb
Commit
1a973bfb
authored
5 years ago
by
Patrick Jentsch
Browse files
Options
Downloads
Patches
Plain Diff
Add page for password reset.
parent
4ef5b480
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/auth/views.py
+10
-2
10 additions, 2 deletions
app/auth/views.py
app/templates/auth/reset_password.html.j2
+13
-7
13 additions, 7 deletions
app/templates/auth/reset_password.html.j2
with
23 additions
and
9 deletions
app/auth/views.py
+
10
−
2
View file @
1a973bfb
from
flask
import
flash
,
redirect
,
render_template
,
request
,
url_for
from
flask_login
import
login_required
,
login_user
,
logout_user
from
flask_login
import
current_user
,
login_required
,
login_user
,
logout_user
from
.
import
auth
from
..
import
db
from
.forms
import
LoginForm
,
PasswordResetRequestForm
,
RegistrationForm
...
...
@@ -45,6 +45,8 @@ def register():
@auth.route
(
'
/reset
'
,
methods
=
[
'
GET
'
,
'
POST
'
])
def
password_reset_request
():
if
not
current_user
.
is_anonymous
:
return
redirect
(
url_for
(
'
main.index
'
))
form
=
PasswordResetRequestForm
()
if
form
.
validate_on_submit
():
user
=
User
.
query
.
filter_by
(
email
=
form
.
email
.
data
.
lower
()).
first
()
...
...
@@ -56,4 +58,10 @@ def password_reset_request():
flash
(
'
An email with instructions to reset your password has been
'
'
sent to you.
'
)
return
redirect
(
url_for
(
'
auth.login
'
))
return
render_template
(
'
auth/reset_password.html.j2
'
,
form
=
form
,
title
=
'
Password Reset
'
)
return
render_template
(
'
auth/reset_password.html.j2
'
,
form
=
form
,
title
=
'
Password Reset
'
)
@auth.route
(
'
/reset/<token>
'
)
def
password_reset
(
token
):
return
'
test
'
This diff is collapsed.
Click to expand it.
app/templates/auth/reset_password.html.j2
+
13
−
7
View file @
1a973bfb
{% extends "base.html.j2" %}
{% block page_content %}
<div class="col s12 m
6
offset-m
3
">
<div class="card
medium
">
<div class="col s12 m
8
offset-m
2
">
<div class="card
small
">
<div class="card-content">
<p>Sign in into an exisiting account or register a new one!</p>
<br>
<div class="card-action">
<a class="btn" href="{{url_for('auth.register')}}">Register</a>
</div>
<span class="card-title">Reset Your Password</span>
<form method="POST">
{{ form.hidden_tag() }}
<div class="input-field">
{{ form.email(class='validate', type='email') }}
{{ form.email.label }}
</div>
<div class="card-action">
{{ form.submit(class='btn right') }}
</div>
</form>
</div>
</div>
</div>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment