nextauthz 1.3.13 → 1.3.15
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/index.mjs +2 -1
- package/package.json +2 -2
- package/src/AuthProvider.tsx +2 -0
- package/src/index.ts +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -35,7 +35,7 @@ type User = Record<string, any>;
|
|
|
35
35
|
/**
|
|
36
36
|
* Factory to create isolated auth instance
|
|
37
37
|
*/
|
|
38
|
-
declare function createAppAuth(storage
|
|
38
|
+
declare function createAppAuth(storage: 'localStorage' | 'sessionStorage' | 'cookie', tokenKey?: string): {
|
|
39
39
|
AuthProvider: ({ children }: {
|
|
40
40
|
children: React.ReactNode;
|
|
41
41
|
}) => react_jsx_runtime.JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ type User = Record<string, any>;
|
|
|
35
35
|
/**
|
|
36
36
|
* Factory to create isolated auth instance
|
|
37
37
|
*/
|
|
38
|
-
declare function createAppAuth(storage
|
|
38
|
+
declare function createAppAuth(storage: 'localStorage' | 'sessionStorage' | 'cookie', tokenKey?: string): {
|
|
39
39
|
AuthProvider: ({ children }: {
|
|
40
40
|
children: React.ReactNode;
|
|
41
41
|
}) => react_jsx_runtime.JSX.Element;
|
package/dist/index.js
CHANGED
|
@@ -63,6 +63,7 @@ function createAuthContext(option) {
|
|
|
63
63
|
const AuthProvider = ({ children }) => {
|
|
64
64
|
const storage = option?.storage ?? "cookie";
|
|
65
65
|
const tokenKey = option?.tokenKey ?? "access_token";
|
|
66
|
+
console.log("storage", storage);
|
|
66
67
|
(0, import_react.useEffect)(() => {
|
|
67
68
|
(0, import_react_token_manager.configureTokenManager)({ storage });
|
|
68
69
|
}, [storage]);
|
|
@@ -187,7 +188,7 @@ var RoleGuard = ({
|
|
|
187
188
|
var RoleGuard_default = RoleGuard;
|
|
188
189
|
|
|
189
190
|
// src/index.ts
|
|
190
|
-
function createAppAuth(storage
|
|
191
|
+
function createAppAuth(storage, tokenKey = "access_token") {
|
|
191
192
|
return createAuthContext({ storage, tokenKey });
|
|
192
193
|
}
|
|
193
194
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.mjs
CHANGED
|
@@ -36,6 +36,7 @@ function createAuthContext(option) {
|
|
|
36
36
|
const AuthProvider = ({ children }) => {
|
|
37
37
|
const storage = option?.storage ?? "cookie";
|
|
38
38
|
const tokenKey = option?.tokenKey ?? "access_token";
|
|
39
|
+
console.log("storage", storage);
|
|
39
40
|
useEffect(() => {
|
|
40
41
|
configureTokenManager({ storage });
|
|
41
42
|
}, [storage]);
|
|
@@ -160,7 +161,7 @@ var RoleGuard = ({
|
|
|
160
161
|
var RoleGuard_default = RoleGuard;
|
|
161
162
|
|
|
162
163
|
// src/index.ts
|
|
163
|
-
function createAppAuth(storage
|
|
164
|
+
function createAppAuth(storage, tokenKey = "access_token") {
|
|
164
165
|
return createAuthContext({ storage, tokenKey });
|
|
165
166
|
}
|
|
166
167
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nextauthz",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.15",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -25,6 +25,6 @@
|
|
|
25
25
|
"zustand": "^5.0.0"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"react-token-manager": "^1.1.
|
|
28
|
+
"react-token-manager": "^1.1.5"
|
|
29
29
|
}
|
|
30
30
|
}
|
package/src/AuthProvider.tsx
CHANGED
|
@@ -32,6 +32,8 @@ export function createAuthContext<UserType extends User = User>(option?: {
|
|
|
32
32
|
const storage = option?.storage ?? 'cookie'
|
|
33
33
|
const tokenKey = option?.tokenKey ?? 'access_token'
|
|
34
34
|
|
|
35
|
+
console.log('storage', storage);
|
|
36
|
+
|
|
35
37
|
useEffect(() => {
|
|
36
38
|
configureTokenManager({ storage })
|
|
37
39
|
}, [storage])
|
package/src/index.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type User = Record<string, any>
|
|
|
11
11
|
* Factory to create isolated auth instance
|
|
12
12
|
*/
|
|
13
13
|
export function createAppAuth(
|
|
14
|
-
storage: 'localStorage' | 'sessionStorage' | 'cookie'
|
|
14
|
+
storage: 'localStorage' | 'sessionStorage' | 'cookie',
|
|
15
15
|
tokenKey: string = 'access_token' // <-- default token key
|
|
16
16
|
) {
|
|
17
17
|
return createAuthContext({ storage, tokenKey })
|