Skip to content

feat: return values from refresh/fetchProfile, expose client#69

Merged
eugenioenko merged 1 commit into
mainfrom
feat/return-values-expose-client
May 7, 2026
Merged

feat: return values from refresh/fetchProfile, expose client#69
eugenioenko merged 1 commit into
mainfrom
feat/return-values-expose-client

Conversation

@eugenioenko
Copy link
Copy Markdown
Owner

Summary

  • OidcClient.refresh() now returns Promise<AuthTokens> instead of Promise<void> — callers get the new token set immediately after await, no need to wait for framework state to propagate
  • OidcClient.fetchProfile() now returns Promise<OidcUser | null> instead of Promise<void>
  • React useAuth() now exposes client: OidcClient on the context value for direct state access outside the React tree
  • Updated AuthActions types across all 8 framework adapters (React, Vue, Angular, Svelte, Solid, Preact, Lit, Kasper)
  • Bumped all packages from 1.0.8 → 1.1.0

Closes #67, closes #68

Test plan

  • CI passes (unit tests, type checks, build)
  • Verify await actions.refresh() returns AuthTokens in an axios interceptor
  • Verify client is accessible from useAuth() in React

🤖 Generated with Claude Code

refresh() now returns Promise<AuthTokens> and fetchProfile() returns
Promise<OidcUser | null>, enabling direct use in HTTP interceptors
without waiting for framework state updates. The React adapter also
exposes the OidcClient instance via useAuth().

Closes #67, closes #68

Bumps all packages to 1.1.0.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@eugenioenko eugenioenko merged commit f649a36 into main May 7, 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.

Actions should return values: refresh() → token, fetchProfile() → profile Expose OidcClient instance from useAuth() in oidc-js-react

1 participant