Skip to content

Commit

Permalink
Merge pull request getredash#1860 from AmarJayR/patch-1
Browse files Browse the repository at this point in the history
Remove /forgot endpoint if REDASH_PASSWORD_LOGIN_ENABLED is false
  • Loading branch information
arikfr authored Jul 3, 2017
2 parents 2b6fe22 + e445fa4 commit 5bb5f46
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion redash/handlers/authentication.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import hashlib
import logging

from flask import flash, redirect, render_template, request, url_for
from flask import abort, flash, redirect, render_template, request, url_for

from flask_login import current_user, login_required, login_user, logout_user
from redash import __version__, limiter, models, settings
Expand Down Expand Up @@ -74,6 +74,9 @@ def reset(token, org_slug=None):

@routes.route(org_scoped_rule('/forgot'), methods=['GET', 'POST'])
def forgot_password(org_slug=None):
if not settings.PASSWORD_LOGIN_ENABLED:
abort(404)

submitted = False
if request.method == 'POST' and request.form['email']:
submitted = True
Expand Down

0 comments on commit 5bb5f46

Please sign in to comment.