@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.esm.js
CHANGED
|
@@ -421,7 +421,8 @@ const useAuthStore = create((set, get) => ({
|
|
|
421
421
|
});
|
|
422
422
|
try {
|
|
423
423
|
const result = await signUp(email, password, name);
|
|
424
|
-
|
|
424
|
+
// Usa o user completo da resposta da API
|
|
425
|
+
const user = result.user || null;
|
|
425
426
|
set({
|
|
426
427
|
user,
|
|
427
428
|
loading: false
|
|
@@ -447,10 +448,10 @@ const useAuthStore = create((set, get) => ({
|
|
|
447
448
|
try {
|
|
448
449
|
const result = await signIn(email, password);
|
|
449
450
|
|
|
450
|
-
//
|
|
451
|
-
let user =
|
|
451
|
+
// Usa o user completo da resposta da API (já contém email, name, image, etc)
|
|
452
|
+
let user = result.user || null;
|
|
452
453
|
|
|
453
|
-
// Se não
|
|
454
|
+
// Se não veio user na resposta, tenta buscar da sessão
|
|
454
455
|
if (!user) {
|
|
455
456
|
const sessionData = await getSession();
|
|
456
457
|
if (sessionData?.user) user = sessionData.user;
|