mirror of
https://github.com/wassname/flask-security.git
synced 2026-08-14 12:20:13 +08:00
Adjust state
This commit is contained in:
@@ -208,7 +208,7 @@ class Security(object):
|
||||
"""
|
||||
def __init__(self, app=None, datastore=None, **kwargs):
|
||||
if app is not None and datastore is not None:
|
||||
self.init_app(app, datastore, **kwargs)
|
||||
self._state = self.init_app(app, datastore, **kwargs)
|
||||
|
||||
def init_app(self, app, datastore, register_blueprint=True):
|
||||
"""Initializes the Flask-Security extension for the specified
|
||||
@@ -253,6 +253,11 @@ class Security(object):
|
||||
|
||||
app.extensions['security'] = state
|
||||
|
||||
return state
|
||||
|
||||
def __getattr__(self, name):
|
||||
return getattr(self._state, name, None)
|
||||
|
||||
|
||||
class AuthenticationProvider(object):
|
||||
"""The default authentication provider implementation."""
|
||||
|
||||
Reference in New Issue
Block a user