mirror of
https://github.com/hanzoai/ui.git
synced 2026-11-20 22:36:27 +00:00
- IamAuthService: OIDC/PKCE-based auth, auto-registers when IAM config present - Enhanced types: avatar, organization fields on HanzoUserInfo - AuthServiceConf: IAM fields (iamServerUrl, iamClientId, etc.) - Firebase becomes optional integration, IAM is the default - Fix npm-publish workflow: add id-token permission for provenance Co-authored-by: Hanzo Dev <[email protected]>
62 lines
1.4 KiB
TypeScript
62 lines
1.4 KiB
TypeScript
/**
|
|
* @hanzo/auth
|
|
*
|
|
* Pluggable authentication library for the Hanzo platform.
|
|
*
|
|
* IAM-first: When `iamServerUrl` and `iamClientId` are provided in
|
|
* AuthServiceConf, the IAM provider auto-registers as the default.
|
|
* All identity providers (Google, GitHub, etc.) are configured in IAM,
|
|
* not client-side.
|
|
*
|
|
* Firebase support is available via @hanzo/auth-firebase (optional legacy).
|
|
*
|
|
* Usage with IAM (recommended):
|
|
* ```ts
|
|
* <AuthServiceProvider conf={{ iamServerUrl: 'https://id.hanzo.ai', iamClientId: 'my-app' }} user={null}>
|
|
* <App />
|
|
* </AuthServiceProvider>
|
|
* ```
|
|
*
|
|
* Usage with custom provider:
|
|
* ```ts
|
|
* import { registerAuthProvider } from '@hanzo/auth'
|
|
* registerAuthProvider('custom', MyCustomAuthService)
|
|
* ```
|
|
*/
|
|
|
|
// Types
|
|
export type {
|
|
HanzoUserInfo,
|
|
HanzoUserInfoValue,
|
|
AuthServiceConf,
|
|
APIResponse
|
|
} from './types'
|
|
|
|
// Service
|
|
export type { AuthService, AuthProvider } from './service'
|
|
export {
|
|
useAuth,
|
|
AuthServiceProvider,
|
|
registerAuthProvider,
|
|
setActiveProvider,
|
|
getActiveProvider,
|
|
hasAuthProvider,
|
|
getRegisteredProviders,
|
|
StubAuthService,
|
|
IamAuthService
|
|
} from './service'
|
|
export type { AuthServiceFactory } from './service'
|
|
|
|
// Components
|
|
export {
|
|
LoginPanel,
|
|
EmailPasswordForm,
|
|
AuthWidget,
|
|
SignupPanel,
|
|
OrgProjectSwitcher
|
|
} from './components'
|
|
export type { OrgProjectSwitcherProps } from './components'
|
|
|
|
// Icons
|
|
export * from './icons'
|