@orsetra/shared-auth 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ZitadelProvider.tsx +2 -3
- package/index.ts +1 -0
- package/package.json +1 -1
package/ZitadelProvider.tsx
CHANGED
|
@@ -21,10 +21,9 @@ interface ZitadelContextType {
|
|
|
21
21
|
|
|
22
22
|
const ZitadelContext = createContext<ZitadelContextType | undefined>(undefined)
|
|
23
23
|
|
|
24
|
-
interface ZitadelProviderProps {
|
|
24
|
+
export interface ZitadelProviderProps {
|
|
25
25
|
children: ReactNode
|
|
26
26
|
config: ZitadelConfig
|
|
27
|
-
/** Render the action button shown inside the session-expired modal. Receives the sign-in handler. */
|
|
28
27
|
renderSessionExpiredAction?: (onReauthenticate: () => void) => ReactNode
|
|
29
28
|
}
|
|
30
29
|
|
|
@@ -46,7 +45,7 @@ export function ZitadelProvider({ children, config, renderSessionExpiredAction }
|
|
|
46
45
|
setIsConfigured(true)
|
|
47
46
|
|
|
48
47
|
const currentUser = await ZitadelAuthService.getUser()
|
|
49
|
-
setUser(currentUser)
|
|
48
|
+
setUser(currentUser?.expired ? null : currentUser)
|
|
50
49
|
} catch (error) {
|
|
51
50
|
console.error("Failed to configure Zitadel auth:", error)
|
|
52
51
|
} finally {
|
package/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Auth exports - Main app
|
|
2
2
|
export { ZitadelProvider, useZitadel } from './ZitadelProvider'
|
|
3
|
+
export type { ZitadelProviderProps } from './ZitadelProvider'
|
|
3
4
|
export { ProtectedRoute } from './ProtectedRoute'
|
|
4
5
|
export { ZitadelAuthService } from './services/zitadel.auth.service'
|
|
5
6
|
export { createAuthConfig } from './config/zitadel.config'
|