@riligar/auth-react 1.19.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 +0 -16
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +0 -16
- 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:
|