-
-
Notifications
You must be signed in to change notification settings - Fork 247
Closed
Description
Hello,
I'm not sure if this is an issue or if this is a expected behavior. Anyway, I'm developing an API which uses JWT tokens for authentication. I'm getting unauthorized when I'm trying to refresh the access token using the example:
@app.route('/refresh', methods=['POST'])
@jwt_refresh_token_required
def refresh():
current_user = get_jwt_identity()
new_token = create_access_token(identity=current_user, fresh=False)
ret = {'access_token': new_token}
return jsonify(ret), 200If the client is located on a different origin than the server, then this function will return unauthorized because of the empty OPTION request before the real POST request is sent.
Shouldn't @jwt_refresh_token_required check if the request is a OPTION request and then ignore the absence of the token but act on all other requests?
Metadata
Metadata
Assignees
Labels
No labels