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