nextauthz 1.3.28 → 1.3.30
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 +1 -0
- package/dist/index.mjs +1 -0
- package/package.json +1 -1
- package/src/AuthProvider.tsx +2 -0
package/dist/index.js
CHANGED
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
package/src/AuthProvider.tsx
CHANGED
|
@@ -59,6 +59,7 @@ export function createAuthContext<UserType extends User = User>(option?: {
|
|
|
59
59
|
if (!userObj || !rolePath) return null
|
|
60
60
|
return rolePath.split('.').reduce((acc: any, key: string) => acc?.[key], userObj) ?? null
|
|
61
61
|
}
|
|
62
|
+
|
|
62
63
|
|
|
63
64
|
/* ---------------------------------- */
|
|
64
65
|
/* Hydrate user from storage */
|
|
@@ -74,6 +75,7 @@ export function createAuthContext<UserType extends User = User>(option?: {
|
|
|
74
75
|
|
|
75
76
|
if (storedUser) {
|
|
76
77
|
const parsedUser = JSON.parse(storedUser) as UserType
|
|
78
|
+
console.log('extractRole', extractRole(parsedUser));
|
|
77
79
|
setUser(parsedUser)
|
|
78
80
|
setRole(extractRole(parsedUser))
|
|
79
81
|
}
|