Skip to content

Commit

Permalink
Allow custom login_manager to be passed in to Flask-Security (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwag956 committed May 6, 2019
1 parent 5123f8e commit fd42915
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion flask_security/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ def _get_state(app, datastore, anonymous_user=None, **kwargs):
kwargs.update(dict(
app=app,
datastore=datastore,
login_manager=_get_login_manager(app, anonymous_user),
principal=_get_principal(app),
pwd_context=_get_pwd_context(app),
hashing_context=_get_hashing_context(app),
Expand All @@ -353,6 +352,10 @@ def _get_state(app, datastore, anonymous_user=None, **kwargs):
_unauthorized_callback=None
))

if 'login_manager' not in kwargs:
kwargs['login_manager'] = _get_login_manager(
app, anonymous_user)

for key, value in _default_forms.items():
if key not in kwargs or not kwargs[key]:
kwargs[key] = value
Expand Down

0 comments on commit fd42915

Please sign in to comment.