Make authorizationUrl and launch exclusive#31
Conversation
- With the release of version 2, we added the `launch` option to customize launching the `authorizationUrl`, but if `launch` is not provided then `authorizationUrl` shouldn't be provided as it's unused, this makes both options exclusive
- Types: explicit Headless vs Managed modes with `never` constraints - Runtime: fix bug where `launch: undefined` caused crash (use typeof check) - browser-auth: conditionally use managed/headless based on launch presence - Add getRedirectUrl() helper for headless mode usability - Tests: update to use valid patterns for each mode
|
Hey! Just pushed a follow-up commit that tightens things up a bit. The core idea of your PR is solid — making these options exclusive makes the API clearer. I noticed a few rough edges while testing:
Let me know what you think. |
582145c to
e7d4b04
Compare
Without `launch`, browserAuth ignores the authorization URL from the MCP SDK, causing the callback server to wait indefinitely. Updated examples and docs to consistently include `launch: open`.
Looks good to me, I have a couple of nit picks (sorry wasn't fast enough to comment before merge):
Thanks for fixing the rest of the bits I missed, love the use of |
|
Both suggestions are reasonable improvements, indeed! Pushed in update in #32. |
launchoption to customize launching theauthorizationUrl, but iflaunchis not provided thenauthorizationUrlshouldn't be provided as it's unused, this makes both options exclusive