-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ext: fix init without oauthlib.client extension #24
ext: fix init without oauthlib.client extension #24
Conversation
@@ -46,7 +47,10 @@ def __init__(self, app): | |||
# Connect signal to remove access tokens on logout | |||
user_logged_out.connect(oauth_logout_handler) | |||
|
|||
oauth = app.extensions['oauthlib.client'] | |||
if 'oauthlib.client' in app.extensions: | |||
oauth = app.extensions['oauthlib.client'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please store the oauth
on self
self.oauth = app.extensions.get('oauthlib.client')
if self.oauth is None:
self.oauth = FlaskOAuth() # NOTE no `app` argument as we are calling `init_app` later
# Add remote applications
self.oauth.init_app(app)
d95f762
to
337c48a
Compare
@JavierDelgadoFernandez please wait for #25 to be merged first and then rebase. Thanks |
@@ -46,21 +47,23 @@ def __init__(self, app): | |||
# Connect signal to remove access tokens on logout | |||
user_logged_out.connect(oauth_logout_handler) | |||
|
|||
oauth = app.extensions['oauthlib.client'] | |||
self.oauth = app.extensions.get('oauthlib.client') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.oauth = app.extensions.get('oauthlib.client') or FlaskOAuth()
?
337c48a
to
e22c290
Compare
@jirikuncar Rebased. |
@JavierDelgadoFernandez please run |
* Fixes the initialization of the extension when there is no oauthlib.client object in extensions. Signed-off-by: Javier Delgado <javier.delgado.fernandez@cern.ch>
e22c290
to
357b1f6
Compare
@jirikuncar Sorry, done. |
oauthlib.client object in extensions.
Signed-off-by: Javier Delgado javier.delgado.fernandez@cern.ch