@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.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
- const user = getCurrentUser();
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
- // Tenta obter usuário do token (se JWT)
453
- let user = getCurrentUser();
453
+ // Usa o user completo da resposta da API ( contém email, name, image, etc)
454
+ let user = result.user || null;
454
455
 
455
- // Se não encontrou no token (sessão opaca), busca do servidor
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;