Merge pull request #402 from eReuse/feature/add-reset-password-link

add reset password link in login page
This commit is contained in:
cayop 2022-11-11 18:03:06 +01:00 committed by GitHub
commit 6addddd974
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -21,7 +21,7 @@
<div class="card-body"> <div class="card-body">
<div class="pt-4 pb-2"> <div class="pt-2 pb-3">
<h5 class="card-title text-center pb-0 fs-4 help">Sign in</h5> <h5 class="card-title text-center pb-0 fs-4 help">Sign in</h5>
{% if form.form_errors %} {% if form.form_errors %}
<p class="text-danger"> <p class="text-danger">
@ -62,6 +62,7 @@
</div> </div>
<div class="col-12"> <div class="col-12">
<p class="small mb-0">Don't have account? <a href="{{ url_register }}">Create an account</a></p> <p class="small mb-0">Don't have account? <a href="{{ url_register }}">Create an account</a></p>
<p class="small mb-0">Forgot password? <a href="{{ url_reset_password }}">Reset your password</a></p>
</div> </div>
</form> </form>

View File

@ -43,10 +43,20 @@ class LoginView(View):
return flask.redirect(next_url or flask.url_for('inventory.devicelist')) return flask.redirect(next_url or flask.url_for('inventory.devicelist'))
url_register = "#" url_register = "#"
url_reset_password = "#"
if 'register' in app.blueprints.keys(): if 'register' in app.blueprints.keys():
url_register = flask.url_for('register.user-registration') url_register = flask.url_for('register.user-registration')
context = {'form': form, 'version': __version__, 'url_register': url_register} if 'reset_password' in app.blueprints.keys():
url_reset_password = flask.url_for('reset_password.reset-password')
context = {
'form': form,
'version': __version__,
'url_register': url_register,
'url_reset_password': url_reset_password,
}
return flask.render_template(self.template_name, **context) return flask.render_template(self.template_name, **context)