File tree Expand file tree Collapse file tree
app/[locale]/oauth/mcp-authorize Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,29 +35,14 @@ export function McpConsentForm({
3535 setError ( null )
3636
3737 try {
38- // POST to MCP server callback — this will redirect us
39- // We use a form submission approach to follow the redirect
40- const form = document . createElement ( "form" )
41- form . method = "POST"
42- form . action = mcpCallbackUrl
43-
44- const fields = {
45- sessionId,
46- userId,
47- userRole,
48- tenantId,
49- }
50-
51- for ( const [ key , value ] of Object . entries ( fields ) ) {
52- const input = document . createElement ( "input" )
53- input . type = "hidden"
54- input . name = key
55- input . value = value
56- form . appendChild ( input )
57- }
58-
59- document . body . appendChild ( form )
60- form . submit ( )
38+ // Redirect to MCP server callback via GET with query params
39+ // The callback will generate an auth code and redirect back to Claude
40+ const url = new URL ( mcpCallbackUrl )
41+ url . searchParams . set ( "session_id" , sessionId )
42+ url . searchParams . set ( "user_id" , userId )
43+ url . searchParams . set ( "user_role" , userRole )
44+ url . searchParams . set ( "tenant_id" , tenantId )
45+ window . location . href = url . toString ( )
6146 } catch ( err ) {
6247 setError ( err instanceof Error ? err . message : "Failed to authorize" )
6348 setLoading ( null )
You can’t perform that action at this time.
0 commit comments