@riligar/auth-react 1.18.0 → 1.19.1
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.esm.js +3 -17
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +3 -17
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -102,17 +102,8 @@ function setStoredToken(token) {
|
|
|
102
102
|
function handleAuthResponse(result) {
|
|
103
103
|
// Tenta encontrar o token em vários lugares possíveis
|
|
104
104
|
const token = result.token || result.session?.token || result.session?.sessionToken;
|
|
105
|
-
console.log('[AuthSDK] Handling Auth Response:', {
|
|
106
|
-
hasToken: !!result.token,
|
|
107
|
-
hasSessionToken: !!result.session?.token,
|
|
108
|
-
hasSessionSessionToken: !!result.session?.sessionToken,
|
|
109
|
-
extractedToken: token
|
|
110
|
-
});
|
|
111
105
|
if (token) {
|
|
112
|
-
console.log('[AuthSDK] Saving token to storage');
|
|
113
106
|
setStoredToken(token);
|
|
114
|
-
} else {
|
|
115
|
-
console.warn('[AuthSDK] No token found in response', result);
|
|
116
107
|
}
|
|
117
108
|
return result;
|
|
118
109
|
}
|
|
@@ -711,19 +702,12 @@ const useAuthStore = zustand.create((set, get) => ({
|
|
|
711
702
|
error: null
|
|
712
703
|
});
|
|
713
704
|
try {
|
|
714
|
-
console.log('[AuthStore] Revoking session:', {
|
|
715
|
-
targetId: sessionId,
|
|
716
|
-
currentId: currentSession?.id,
|
|
717
|
-
totalSessions: sessions.length
|
|
718
|
-
});
|
|
719
|
-
|
|
720
705
|
// Detect if current session OR last remaining session
|
|
721
706
|
const isCurrent = sessionId === currentSession?.id;
|
|
722
707
|
const isLast = sessions.length === 1 && sessions[0].id === sessionId;
|
|
723
708
|
|
|
724
709
|
// Se for a sessão atual ou a última, faz logout normal
|
|
725
710
|
if (isCurrent || isLast) {
|
|
726
|
-
console.log('[AuthStore] Revoking current/last session -> Executing signOut');
|
|
727
711
|
await signOut();
|
|
728
712
|
// signOut já limpa loading states e erros no finally, mas
|
|
729
713
|
// como estamos dentro do fluxo deste método, garantimos:
|
|
@@ -2105,6 +2089,8 @@ function UserProfile({
|
|
|
2105
2089
|
maxAvatarSize = 500 * 1024,
|
|
2106
2090
|
// 500KB
|
|
2107
2091
|
|
|
2092
|
+
// Custom sections (React nodes to render after built-in sections)
|
|
2093
|
+
customSections,
|
|
2108
2094
|
...containerProps
|
|
2109
2095
|
}) {
|
|
2110
2096
|
// Local state - which section is expanded
|
|
@@ -2957,7 +2943,7 @@ function UserProfile({
|
|
|
2957
2943
|
})]
|
|
2958
2944
|
})]
|
|
2959
2945
|
})]
|
|
2960
|
-
})]
|
|
2946
|
+
}), customSections]
|
|
2961
2947
|
});
|
|
2962
2948
|
|
|
2963
2949
|
// Renderizar como Modal
|