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