nextauthz 1.3.15 → 1.3.16
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.js +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +1 -1
- package/src/AuthProvider.tsx +2 -3
package/dist/index.js
CHANGED
|
@@ -101,10 +101,10 @@ function createAuthContext(option) {
|
|
|
101
101
|
const tokenValue = tokens[tokenKey] ?? tokens["access_token"] ?? Object.values(tokens)[0];
|
|
102
102
|
manager.setTokens({
|
|
103
103
|
...tokens,
|
|
104
|
-
[tokenKey]: tokenValue
|
|
105
|
-
user: JSON.stringify(userData ?? null)
|
|
104
|
+
[tokenKey]: tokenValue
|
|
106
105
|
});
|
|
107
|
-
|
|
106
|
+
const parsedUser = JSON.stringify(userData);
|
|
107
|
+
if (parsedUser) setUser(parsedUser);
|
|
108
108
|
setRole(role2 ?? null);
|
|
109
109
|
setAuth(true);
|
|
110
110
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -74,10 +74,10 @@ function createAuthContext(option) {
|
|
|
74
74
|
const tokenValue = tokens[tokenKey] ?? tokens["access_token"] ?? Object.values(tokens)[0];
|
|
75
75
|
manager.setTokens({
|
|
76
76
|
...tokens,
|
|
77
|
-
[tokenKey]: tokenValue
|
|
78
|
-
user: JSON.stringify(userData ?? null)
|
|
77
|
+
[tokenKey]: tokenValue
|
|
79
78
|
});
|
|
80
|
-
|
|
79
|
+
const parsedUser = JSON.stringify(userData);
|
|
80
|
+
if (parsedUser) setUser(parsedUser);
|
|
81
81
|
setRole(role2 ?? null);
|
|
82
82
|
setAuth(true);
|
|
83
83
|
};
|
package/package.json
CHANGED
package/src/AuthProvider.tsx
CHANGED
|
@@ -88,10 +88,9 @@ export function createAuthContext<UserType extends User = User>(option?: {
|
|
|
88
88
|
manager.setTokens({
|
|
89
89
|
...tokens,
|
|
90
90
|
[tokenKey]: tokenValue,
|
|
91
|
-
user: JSON.stringify(userData ?? null),
|
|
92
91
|
})
|
|
93
|
-
|
|
94
|
-
if (
|
|
92
|
+
const parsedUser = JSON.stringify(userData as any)
|
|
93
|
+
if (parsedUser) setUser(parsedUser as any)
|
|
95
94
|
setRole(role ?? null)
|
|
96
95
|
setAuth(true)
|
|
97
96
|
}
|