You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for example on this page of documentation we can see:
@app.route('/user')
@require_oauth()
def user_profile():
user = current_token.user
return jsonify(user)
# or with None
@app.route('/user')
@require_oauth(None)
def user_profile():
user = current_token.user
return jsonify(user)
If we speak about transparency in coding, @require_oauth() is not an obvious practice.
More often, you can encounter @require_oauth.
Organizing the decorator for both cases — calling with and without attributes — is easy:
def __call__(self, *args, **kwargs):
if args and callable(args[0]):
return super().__call__()(*args, **kwargs)
return super().__call__(*args, **kwargs)
The text was updated successfully, but these errors were encountered:
for example on this page of documentation we can see:
If we speak about transparency in coding,
@require_oauth()
is not an obvious practice.More often, you can encounter
@require_oauth
.Organizing the decorator for both cases — calling with and without attributes — is easy:
The text was updated successfully, but these errors were encountered: