Custom GPT Action: redirect to /undefined (home page) - Token endpoint works via curl but ChatGPT fails to complete flow

Hey everyone,

My Custom GPT Action was working perfectly until ~1-2 weeks ago. Now it redirects to https://chatgpt.com/undefined after the callback step. No changes were made to my code or configuration.

Setup

  • Custom GPT with OAuth authentication

  • Microsoft Entra ID (Azure AD) as identity provider

  • Azure Function as my OAuth proxy

The Critical Evidence

When prompting inside the custom GPT, the action gets invoked. the user signs in to the the external URL (azure function) > authorize/callback flow gets initiated. The expected output is authorize/callback connects successfully and redirects back to the custom GPT for querying against the endpoints.

During the authorize/callback flow, ChatGPT redirects to a URL containing the authorization code in the browser:

https://chatgpt.com/aip/g-.../oauth/callback?code=1.ARsAUFzGGuTX...&state=27bc11ed-...

I can take that exact code and successfully call my token endpoint via curl:

bash

curl -X POST https://my-function-app.azurewebsites.net/api/oauth/token \
  -d "code=1.ARsAUFzGGuTX..."

Returns valid tokens:

json

{
  "token_type": "Bearer",
  "scope": "api://client-id/access",
  "expires_in": 4352,
  "access_token": "eyJ0eXAiOiJKV1Q...",
  "id_token": "eyJ0eXAiOiJKV1Q..."
}

This proves my token endpoint works correctly. ChatGPT is either not calling it, or not processing the valid response.

What I’ve Tried

  • Deleting and re-adding OAuth configuration

  • Re-saving the GPT multiple times

  • Adding both chat.openai.com and chatgpt.com callback URLs

  • Testing in incognito mode and different browsers

  • Testing on separate DEV and PRD environments (same issue)

  • Creating a completely new GPT

Flow Breakdown

  1. /oauth/authorize - works

  2. Microsoft Entra authentication - works

  3. /oauth/callback - works, redirects to ChatGPT with code

  4. ChatGPT should call /oauth/token - fails here?

  5. Redirects to https://chatgpt.com/undefined, away from CustomGPT

Questions

  1. Has anyone else experienced this recently?

  2. Did OpenAI change something with OAuth handling?

  3. Is there a new requirement (like refresh_token) that wasn’t needed before?

Any help appreciated. I am at my wits-end troubleshooting something that was working with absolutely no changes, flawlessly, just some time ago.