Align Quick OAuth Flow with Guided OAuth Flow behavior

- In oauth-state-machine.ts
  - in token_request transition
    - ensure resource is URL type, not string
    - this fixes Quick flow which was sending string, while guided was using proper URL type and working
This commit is contained in:
cliffhall 2025-08-15 14:44:51 -04:00
commit 0831e812bb

View file

@ -177,7 +177,7 @@ export const oauthTransitions: Record<OAuthStep, StateTransition> = {
authorizationCode: context.state.authorizationCode,
codeVerifier,
redirectUri: context.provider.redirectUrl,
resource: context.state.resource ?? undefined,
resource: context.state.resource ? (context.state.resource instanceof URL ? context.state.resource : new URL(context.state.resource)) : undefined,
});
context.provider.saveTokens(tokens);