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
@api.route('/<intra_id>')@api.param('intra_id', 'The intranet identifier')@api.response(404, 'Intranet not found.')classIntranet(Resource):
@api.doc(security='Bearer Auth')@api.doc('get a intranet')@api.marshal_with(_intranet)@token_requireddefget(self, intra_id):
intranet=get_intranet(intra_id)
ifnotintranet:
api.abort(404)
else:
returnintranet
@token_required forces a valid Authorization key, but this decorator cannot be accesed to get the token object (containing user_id, e-mail, is administrator etc.).
I can return the token object by passing it to **kwargs in the decorated function using
kwargs['token]'=token
but I'm not sure if this is the proper way to do it.
How do I properly get the token object from the decorator?
The text was updated successfully, but these errors were encountered:
@token_required forces a valid Authorization key, but this decorator cannot be accesed to get the token object (containing user_id, e-mail, is administrator etc.).
I can return the token object by passing it to **kwargs in the decorated function using
but I'm not sure if this is the proper way to do it.
How do I properly get the token object from the decorator?
The text was updated successfully, but these errors were encountered: