@riligar/auth-react 1.24.0 → 1.25.0
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 +5 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -423,7 +423,8 @@ const useAuthStore = zustand.create((set, get) => ({
|
|
|
423
423
|
});
|
|
424
424
|
try {
|
|
425
425
|
const result = await signUp(email, password, name);
|
|
426
|
-
|
|
426
|
+
// Usa o user completo da resposta da API
|
|
427
|
+
const user = result.user || null;
|
|
427
428
|
set({
|
|
428
429
|
user,
|
|
429
430
|
loading: false
|
|
@@ -449,10 +450,10 @@ const useAuthStore = zustand.create((set, get) => ({
|
|
|
449
450
|
try {
|
|
450
451
|
const result = await signIn(email, password);
|
|
451
452
|
|
|
452
|
-
//
|
|
453
|
-
let user =
|
|
453
|
+
// Usa o user completo da resposta da API (já contém email, name, image, etc)
|
|
454
|
+
let user = result.user || null;
|
|
454
455
|
|
|
455
|
-
// Se não
|
|
456
|
+
// Se não veio user na resposta, tenta buscar da sessão
|
|
456
457
|
if (!user) {
|
|
457
458
|
const sessionData = await getSession();
|
|
458
459
|
if (sessionData?.user) user = sessionData.user;
|