mirror of
https://github.com/wassname/flask-security.git
synced 2026-06-29 16:30:04 +08:00
Polish
This commit is contained in:
@@ -232,14 +232,11 @@ class Security(object):
|
||||
url_prefix=cv('URL_PREFIX', app=app))
|
||||
app.register_blueprint(bp)
|
||||
|
||||
if not hasattr(app, 'extensions'):
|
||||
app.extensions = {}
|
||||
|
||||
kwargs = {}
|
||||
for key, value in get_config(app).items():
|
||||
kwargs[key.lower()] = value
|
||||
|
||||
app.extensions['security'] = _SecurityState(
|
||||
state = _SecurityState(
|
||||
app=app,
|
||||
datastore=datastore,
|
||||
auth_provider=AuthenticationProvider(),
|
||||
@@ -251,6 +248,11 @@ class Security(object):
|
||||
token_auth_serializer=_get_token_auth_serializer(app),
|
||||
**kwargs)
|
||||
|
||||
if not hasattr(app, 'extensions'):
|
||||
app.extensions = {}
|
||||
|
||||
app.extensions['security'] = state
|
||||
|
||||
|
||||
class AuthenticationProvider(object):
|
||||
"""The default authentication provider implementation."""
|
||||
|
||||
Reference in New Issue
Block a user