From cd2367c97e16baca8416696537ab84af4f01d8c4 Mon Sep 17 00:00:00 2001 From: Timo Jancke Date: Thu, 8 Aug 2024 22:22:47 +0200 Subject: [PATCH] expose signinCallback for native applications --- docs/react-oidc-context.api.md | 2 ++ src/AuthContext.ts | 1 + src/AuthProvider.tsx | 3 +++ 3 files changed, 6 insertions(+) diff --git a/docs/react-oidc-context.api.md b/docs/react-oidc-context.api.md index d4ade225..83e1fd37 100644 --- a/docs/react-oidc-context.api.md +++ b/docs/react-oidc-context.api.md @@ -25,6 +25,8 @@ export const AuthContext: React_2.Context; // @public (undocumented) export interface AuthContextProps extends AuthState { + // (undocumented) + callSigninCallback(url: string): Promise; // (undocumented) clearStaleState(): Promise; // (undocumented) diff --git a/src/AuthContext.ts b/src/AuthContext.ts index 7abd41b5..8471eddb 100644 --- a/src/AuthContext.ts +++ b/src/AuthContext.ts @@ -30,6 +30,7 @@ export interface AuthContextProps extends AuthState { revokeTokens(types?: RevokeTokensTypes): Promise; startSilentRenew(): void; stopSilentRenew(): void; + callSigninCallback(url: string): Promise; } /** diff --git a/src/AuthProvider.tsx b/src/AuthProvider.tsx index a666a495..907281f6 100644 --- a/src/AuthProvider.tsx +++ b/src/AuthProvider.tsx @@ -296,12 +296,15 @@ export const AuthProvider = (props: AuthProviderProps): JSX.Element => { onRemoveUser && await onRemoveUser(); }, [userManager, onRemoveUser]); + const callSigninCallback = (url: string) => userManager.signinCallback(url); + return ( {children}