Skip to content

feat(login): add loginWithProvider - #19

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-9135-oauth-core-add-loginwithproviderprovider-save-helper
Sep 27, 2026
Merged

TheGreatAxios merged 2 commits into
mainfrom
cl-9135-oauth-core-add-loginwithproviderprovider-save-helper

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • OAuthLoginProvider, OAuthLoginProviders, callbackTargetFor and the shared callback pages (signedInHtml, signInFailedHtml) live in src/provider.ts; src/hub/registry.ts is deleted. OAuthLoginProvider and callbackTargetFor export from the root and leave ./hub; OAuthLoginProviders stays on ./hub.
  • The hub mount uses the shared pages, so its "Signed in" page no longer mentions workbench.
  • loginWithProvider(provider, { save, profile, signal, openInBrowser }) runs the loopback PKCE login against the provider's fixed redirect_uri, exchanges the code with provider.exchange, saves via save, and returns the profile. All options are required; provider.metadata is not applied (documented in the doc comment).
  • Based on main; chore(release): 0.2.0 #20 is stacked on it.

Verification

  • bun install --frozen-lockfile, bun run check (typecheck, lint, format:check, 55 tests), bun run build: pass. A new test drives a real loopback callback on a free port against a stub provider.

Closes CL-9135

@TheGreatAxios
TheGreatAxios force-pushed the cl-9135-oauth-core-add-loginwithproviderprovider-save-helper branch 3 times, most recently from 91436ee to b34ae3c Compare September 25, 2026 21:26
OAuthLoginProvider and callbackTargetFor need neither hono nor @intX, so
they move to the root entry and leave the hub entry. The hub mount's
callback pages move with them and drop the workbench-specific copy.
It runs the loopback PKCE login against a provider's fixed
redirect_uri, saves the profile, and returns it. Hosts that need their
own callback pages, or to show the staged profile before committing it,
keep using startOAuthLogin.
@TheGreatAxios
TheGreatAxios force-pushed the cl-9135-oauth-core-add-loginwithproviderprovider-save-helper branch from b34ae3c to 9d60098 Compare September 26, 2026 01:29
@TheGreatAxios TheGreatAxios changed the title feat(login): add loginWithProvider and export OAuthLoginProvider from the root (CL-9135) feat(login): add loginWithProvider Sep 26, 2026
@TheGreatAxios
TheGreatAxios added this pull request to stack #21 September 26, 2026 01:59
@TheGreatAxios
TheGreatAxios removed this pull request from stack #21 September 26, 2026 02:52
@TheGreatAxios
TheGreatAxios added this pull request to stack #24 September 26, 2026 02:52
@TheGreatAxios
TheGreatAxios merged commit 97cd251 into main Sep 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant