@versini/auth-provider 6.4.3 → 7.0.0

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +12 -14
  2. package/dist/index.js +856 -1266
  3. package/package.json +3 -4
package/dist/index.d.ts CHANGED
@@ -1,15 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { AUTH_TYPES } from '@versini/auth-common';
3
- export { AUTH_TYPES, isGranted } from '@versini/auth-common';
4
2
  import * as react from 'react';
5
-
6
- type AuthenticationTypes =
7
- | typeof AUTH_TYPES.PASSKEY
8
- | typeof AUTH_TYPES.CODE
9
- | typeof AUTH_TYPES.ID_TOKEN
10
- | typeof AUTH_TYPES.ACCESS_TOKEN
11
- | typeof AUTH_TYPES.ID_AND_ACCESS_TOKEN
12
- | null;
3
+ export { AUTH_TYPES, isGranted } from '@versini/auth-common';
13
4
 
14
5
  type AuthProviderProps = {
15
6
  children: React.ReactNode;
@@ -24,7 +15,6 @@ type AuthState = {
24
15
  isLoading: boolean;
25
16
  isAuthenticated: boolean;
26
17
  logoutReason?: string;
27
- authenticationType: AuthenticationTypes;
28
18
  user?: {
29
19
  userId?: string;
30
20
  username?: string;
@@ -35,7 +25,6 @@ type AuthState = {
35
25
  type LoginProps = (
36
26
  username: string,
37
27
  password: string,
38
- type?: typeof AUTH_TYPES.CODE | typeof AUTH_TYPES.PASSKEY,
39
28
  ) => Promise<boolean>;
40
29
 
41
30
  type AuthContextProps = {
@@ -43,10 +32,19 @@ type AuthContextProps = {
43
32
  logout: (e?: any) => void;
44
33
  getAccessToken: () => Promise<string>;
45
34
  getIdToken: () => string;
46
- registeringForPasskey: () => Promise<any>;
47
- loginWithPasskey: () => Promise<any>;
35
+ registeringForPasskey: () => Promise<boolean>;
36
+ loginWithPasskey: () => Promise<boolean>;
48
37
  } & AuthState;
49
38
 
39
+ /**
40
+ * AuthProvider component properties.
41
+ *
42
+ * @param children - The children of the component.
43
+ * @param sessionExpiration - The session expiration time.
44
+ * @param clientId - The client ID.
45
+ * @param domain - The domain.
46
+ * @param debug - The debug flag.
47
+ */
50
48
  declare const AuthProvider: ({ children, sessionExpiration, clientId, domain, debug, }: AuthProviderProps) => react_jsx_runtime.JSX.Element;
51
49
 
52
50
  declare const useAuth: (context?: react.Context<AuthContextProps>) => AuthContextProps;