@nibssplc/cams-sdk-react 0.0.1-beta.41 → 0.0.1-beta.9
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/dist/components/CAMSMSALProvider.d.ts +5 -13
- package/dist/components/CAMSProvider.d.ts +1 -6
- package/dist/components/ProtectedRoute.d.ts +1 -1
- package/dist/hooks/useCAMSMSALAuth.d.ts +7 -5
- package/dist/index.cjs.js +1383 -609
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.esm.js +1385 -609
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +18258 -0
- package/dist/index.umd.js.map +1 -0
- package/package.json +7 -10
- package/dist/components/ClientOnly.d.ts +0 -6
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { PublicClientApplication, Configuration } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
interface CAMSMSALContextValue extends UseCAMSMSALAuthReturn {
|
|
6
|
-
userProfile: Profile | null;
|
|
7
|
-
setUserProfile: (profile: Profile | null) => void;
|
|
8
|
-
}
|
|
9
|
-
export interface CAMSMSALProviderProps extends UseCAMSMSALAuthOptions {
|
|
10
|
-
children: React.ReactNode;
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { PublicClientApplication, Configuration } from '@azure/msal-browser';
|
|
3
|
+
export interface CAMSMSALProviderProps {
|
|
4
|
+
children: ReactNode;
|
|
11
5
|
msalConfig: Configuration;
|
|
12
6
|
msalInstance?: PublicClientApplication;
|
|
13
7
|
}
|
|
14
|
-
export declare function CAMSMSALProvider(
|
|
15
|
-
export declare function useCAMSMSALContext(): CAMSMSALContextValue;
|
|
16
|
-
export {};
|
|
8
|
+
export declare function CAMSMSALProvider({ children, msalConfig, msalInstance }: CAMSMSALProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { CAMSConfig } from '@nibssplc/cams-sdk';
|
|
3
3
|
import { UseCAMSAuthReturn, UseCAMSAuthOptions } from '../hooks/useCAMSAuth';
|
|
4
|
-
import { UseCAMSMSALAuthOptions } from '../hooks/useCAMSMSALAuth';
|
|
5
4
|
interface CAMSContextValue extends UseCAMSAuthReturn {
|
|
6
5
|
defaultConfig?: Partial<CAMSConfig>;
|
|
7
|
-
isAuthenticated: boolean;
|
|
8
|
-
idToken: string | null;
|
|
9
|
-
accessToken: string | null;
|
|
10
6
|
}
|
|
11
7
|
export interface CAMSProviderProps extends UseCAMSAuthOptions {
|
|
12
8
|
children: ReactNode;
|
|
13
9
|
defaultConfig?: Partial<CAMSConfig>;
|
|
14
|
-
msalOptions?: UseCAMSMSALAuthOptions;
|
|
15
10
|
}
|
|
16
|
-
export declare function CAMSProvider({ children, defaultConfig,
|
|
11
|
+
export declare function CAMSProvider({ children, defaultConfig, ...authOptions }: CAMSProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
17
12
|
export declare function useCAMSContext(): CAMSContextValue;
|
|
18
13
|
export {};
|
|
@@ -4,4 +4,4 @@ export interface ProtectedRouteProps {
|
|
|
4
4
|
fallback?: ReactNode;
|
|
5
5
|
redirectTo?: string;
|
|
6
6
|
}
|
|
7
|
-
export declare function ProtectedRoute({ children, fallback, redirectTo }: ProtectedRouteProps): string | number |
|
|
7
|
+
export declare function ProtectedRoute({ children, fallback, redirectTo }: ProtectedRouteProps): string | number | true | Iterable<React.ReactNode> | import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AccountInfo } from "@azure/msal-browser";
|
|
2
|
+
import { CAMSError, Profile } from "@nibssplc/cams-sdk";
|
|
2
3
|
export interface UseCAMSMSALAuthOptions {
|
|
3
4
|
onAuthSuccess?: (token: string) => void;
|
|
4
5
|
onAuthError?: (error: CAMSError) => void;
|
|
5
6
|
onTokenExpired?: () => void;
|
|
7
|
+
onMFARequired?: (msalToken: string, account: AccountInfo) => void;
|
|
6
8
|
scopes?: string[];
|
|
7
9
|
mfaUrl?: string;
|
|
8
|
-
prompt?: string;
|
|
9
10
|
}
|
|
10
11
|
export interface UseCAMSMSALAuthReturn {
|
|
11
12
|
login: () => Promise<void>;
|
|
12
13
|
logout: () => Promise<void>;
|
|
13
|
-
|
|
14
|
+
completeMFA: (mfaToken: string) => void;
|
|
14
15
|
isAuthenticated: boolean;
|
|
15
16
|
isLoading: boolean;
|
|
17
|
+
isMFAPending: boolean;
|
|
16
18
|
error: CAMSError | null;
|
|
17
19
|
token: string | null;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
profile: Profile | null;
|
|
21
|
+
account: AccountInfo | null;
|
|
20
22
|
}
|
|
21
23
|
export declare function useCAMSMSALAuth(options?: UseCAMSMSALAuthOptions): UseCAMSMSALAuthReturn;
|