nextauthz 1.1.7 → 1.1.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/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
- import React__default, { ReactNode } from 'react';
3
+ import React__default from 'react';
4
4
 
5
5
  type AuthContextType<UserType> = {
6
6
  user: UserType | null;
@@ -10,18 +10,6 @@ type AuthContextType<UserType> = {
10
10
  loading: boolean;
11
11
  error: Error | null;
12
12
  };
13
- type AuthContextOptions = {
14
- storage?: 'localStorage' | 'sessionStorage' | 'cookie';
15
- };
16
- /**
17
- * Factory to create AuthProvider and typed useAuth hook
18
- */
19
- declare function createAuthContext<UserType>(options?: AuthContextOptions): {
20
- AuthProvider: ({ children }: {
21
- children: ReactNode;
22
- }) => react_jsx_runtime.JSX.Element;
23
- useAuth: () => AuthContextType<UserType>;
24
- };
25
13
 
26
14
  type AuthGuardProps = {
27
15
  children: React__default.ReactNode;
@@ -36,16 +24,18 @@ type RoleGuardProps = {
36
24
  allowedRoles: string[];
37
25
  redirectTo?: string;
38
26
  };
39
- declare const RoleGuard: React__default.FC<RoleGuardProps>;
27
+ declare const RoleGuard: ({ children, allowedRoles, redirectTo, }: RoleGuardProps) => react_jsx_runtime.JSX.Element;
40
28
 
41
- type User = {
42
- [key: string]: any;
43
- };
29
+ type User = any;
44
30
  declare function createAppAuth(storage?: 'localStorage' | 'sessionStorage' | 'cookie'): {
45
31
  AuthProvider: ({ children }: {
46
32
  children: React.ReactNode;
47
33
  }) => react_jsx_runtime.JSX.Element;
48
- useAuth: () => AuthContextType<User>;
34
+ useAuth: () => AuthContextType<any>;
49
35
  };
36
+ declare const AuthProvider: ({ children }: {
37
+ children: React.ReactNode;
38
+ }) => react_jsx_runtime.JSX.Element;
39
+ declare const useAuth: () => AuthContextType<any>;
50
40
 
51
- export { AuthGuard, RoleGuard, type User, createAppAuth, createAuthContext };
41
+ export { AuthGuard, AuthProvider, RoleGuard, type User, createAppAuth, useAuth };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
- import React__default, { ReactNode } from 'react';
3
+ import React__default from 'react';
4
4
 
5
5
  type AuthContextType<UserType> = {
6
6
  user: UserType | null;
@@ -10,18 +10,6 @@ type AuthContextType<UserType> = {
10
10
  loading: boolean;
11
11
  error: Error | null;
12
12
  };
13
- type AuthContextOptions = {
14
- storage?: 'localStorage' | 'sessionStorage' | 'cookie';
15
- };
16
- /**
17
- * Factory to create AuthProvider and typed useAuth hook
18
- */
19
- declare function createAuthContext<UserType>(options?: AuthContextOptions): {
20
- AuthProvider: ({ children }: {
21
- children: ReactNode;
22
- }) => react_jsx_runtime.JSX.Element;
23
- useAuth: () => AuthContextType<UserType>;
24
- };
25
13
 
26
14
  type AuthGuardProps = {
27
15
  children: React__default.ReactNode;
@@ -36,16 +24,18 @@ type RoleGuardProps = {
36
24
  allowedRoles: string[];
37
25
  redirectTo?: string;
38
26
  };
39
- declare const RoleGuard: React__default.FC<RoleGuardProps>;
27
+ declare const RoleGuard: ({ children, allowedRoles, redirectTo, }: RoleGuardProps) => react_jsx_runtime.JSX.Element;
40
28
 
41
- type User = {
42
- [key: string]: any;
43
- };
29
+ type User = any;
44
30
  declare function createAppAuth(storage?: 'localStorage' | 'sessionStorage' | 'cookie'): {
45
31
  AuthProvider: ({ children }: {
46
32
  children: React.ReactNode;
47
33
  }) => react_jsx_runtime.JSX.Element;
48
- useAuth: () => AuthContextType<User>;
34
+ useAuth: () => AuthContextType<any>;
49
35
  };
36
+ declare const AuthProvider: ({ children }: {
37
+ children: React.ReactNode;
38
+ }) => react_jsx_runtime.JSX.Element;
39
+ declare const useAuth: () => AuthContextType<any>;
50
40
 
51
- export { AuthGuard, RoleGuard, type User, createAppAuth, createAuthContext };
41
+ export { AuthGuard, AuthProvider, RoleGuard, type User, createAppAuth, useAuth };