Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
Allow custom login_manager to be passed in to Flask-Security
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaza authored and jirikuncar committed Oct 24, 2017
1 parent 1508fa5 commit 53c6547
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 @@ -337,7 +337,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 @@ -351,6 +350,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 53c6547

Please sign in to comment.