-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Open
Description
I used the example code, added client_url and authoriziation_url, and tested the auth flow. Everything was working before chatgpt called my POST authorization_url. I could see my authorization_url was called and returned 200. However, the chatGPT UI showed a toast saying, "couldn't install the plunging." The network tab showed the "internal server error."
I think the problem is my authorization_url response. Could you please share what the expected authorization_url response is? Is there a way that I can see the internal server error message for debugging?
Here is my example code.
@app.get("/client_url")
async def authorize():
parsed_url = urlparse(quart.request.url)
query = parse_qs(parsed_url.query)
chat_gpt_callback_url = query['redirect_uri'][0]
redirect_url = f'{chat_gpt_callback_url}/?code=1234'
return quart.redirect(redirect_url)
@app.post("/authorization_url")
async def token():
request = await quart.request.get_json(force=True)
return quart.Response(response=json.dumps({
"access_token": "SlAV32hkKG",
"token_type": "Bearer",
"refresh_token": "8xLOxBtZp8",
"expires_in": 3600,
"id_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}), status=200)
Metadata
Metadata
Assignees
Labels
No labels