Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions app/(protected)/dashboard/_hooks/useUserProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import { toast } from 'react-toastify';
export const useUserProfile = () => {
const { user } = useAuth();

console.log(user);

const [loading, setLoading] = useState(true);
const [userForm, setUserForm] = useState({
displayName: user?.displayName || '',
Expand Down
2 changes: 2 additions & 0 deletions app/_apis/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ import myAxios from './myAxios.config';
export const registerUser = async (data: RegisterUserData) => myAxios.post('/auth/signup', data);

export const verifySession = async () => myAxios.get('/api/v1/auth/me');

export const generateUser = async () => myAxios.post('/api/v1/user/create');
2 changes: 1 addition & 1 deletion app/_components/AsideRoom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default function AsideRoom() {
<li key={room.id} className="text-white p-2 bg-purple-2 rounded-lg mb-2">
<Link href={`/dashboard/room/${room.id}`}>
<p className="font-bold truncate">{room.name}</p>
<p>{room.lastMessage.content}</p>
<p className="truncate">{room.lastMessage.content}</p>
</Link>
</li>
))}
Expand Down
4 changes: 3 additions & 1 deletion app/_hooks/useAuth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from 'firebase/auth';
import { auth, googleProvider } from '../_lib/_firebase/firebase.config';
import { loginSchema, registerSchema } from '../(auth)/login/_lib/_schemas/auth';
import { registerUser } from '../_apis/auth';
import { generateUser, registerUser } from '../_apis/auth';
import { createSession, deleteSession } from '../(auth)/login/_lib/_actions/session';
import { GoogleAuthProvider } from 'firebase/auth/web-extension';

Expand Down Expand Up @@ -84,6 +84,8 @@ export const useAuth = create<Auth>()(set => ({

// Crear una sesión con el token obtenido
await createSession(token);

await generateUser();
} catch (error) {
console.error('Error during Google login:', error);
}
Expand Down