Skip to content

Commit

Permalink
add state to requests
Browse files Browse the repository at this point in the history
recommended by the docs
  • Loading branch information
prochy-exe committed Apr 27, 2024
1 parent 15ef5a3 commit 76a3e27
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion malfetcher/mal_config_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def make_request(code):
'grant_type': "authorization_code",
'code': code,
'redirect_uri': f"http://localhost:8888/access_token",
'code_verifier': code_verifier
'code_verifier': code_verifier,
'state': "authrequest"
}
response = requests.post("https://myanimelist.net/v1/oauth2/token", data=json, headers=headers)
return response.json()
Expand Down Expand Up @@ -137,6 +138,8 @@ def generate_api_key(client_id, client_secret):
global_tooltip += "&redirect_uri=http://localhost:8888/access_token"
global_tooltip += f"&code_challenge={code_verifier}"
global_tooltip += "&code_challenge_method=plain"
global_tooltip += "&state=authrequest"

setup_function() # Start the server here
user_token = access_token
gevent.killall(
Expand Down

0 comments on commit 76a3e27

Please sign in to comment.