fix: MCP OAuth 303 redirect, send dialog auto-close, bank details null payload (#175)

* fix: MCP OAuth 303 redirect, send dialog auto-close, bank details null payload

- OAuth authorize: use 303 See Other instead of default 307, which
  preserved POST method and caused Claude's callback to return 405
- SendInvoiceDialog: close dialog and show toast after email send
  instead of leaving a success message that requires manual close
- BankDetailsSetupDialog: omit empty fields from payload instead of
  sending null, which fails Zod validation on non-nullable schema fields

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor: remove dead sentMessage state and fix stale comment

Remove sentMessage state, its success banner JSX, and the CheckCircle2
import — all unreachable after the dialog now auto-closes on email send.
Fix stale "to null" comment in BankDetailsSetupDialog.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jakob Wennberg
2026-04-04 10:27:40 +02:00
committed by GitHub
co-authored by Claude Opus 4.6
parent c4a6d16e94
commit e2d9c8bb85
3 changed files with 37 additions and 53 deletions
+5 -2
View File
@@ -38,7 +38,7 @@ function errorRedirect(redirectUri: string, state: string | null, error: string,
url.searchParams.set('error', error)
url.searchParams.set('error_description', desc)
if (state) url.searchParams.set('state', state)
return NextResponse.redirect(url.toString())
return NextResponse.redirect(url.toString(), 303)
}
/**
@@ -205,7 +205,10 @@ export async function POST(request: Request) {
callbackUrl.searchParams.set('code', code)
if (state) callbackUrl.searchParams.set('state', state)
return NextResponse.redirect(callbackUrl.toString())
// 303 See Other: forces browser to GET the callback URL, even though this
// handler was reached via POST. NextResponse.redirect() defaults to 307,
// which preserves POST and causes Claude's callback to return 405.
return NextResponse.redirect(callbackUrl.toString(), 303)
}
function escapeHtml(str: string): string {