diff --git a/app/(auth)/login/_lib/_actions/session.ts b/app/(auth)/login/_lib/_actions/session.ts index 51af558..ba84e6d 100644 --- a/app/(auth)/login/_lib/_actions/session.ts +++ b/app/(auth)/login/_lib/_actions/session.ts @@ -12,6 +12,19 @@ export async function createSession(token: string) { }); } +export async function createPendingPath(path: string) { + (await cookies()).set('pendingPath', path, { + httpOnly: true, + secure: process.env.NODE_ENV === 'production', + sameSite: 'lax', + maxAge: 60 * 60 * 24 * 1, // 1 dia + }); +} + +export async function deletePendingPath() { + (await cookies()).delete('pendingPath'); +} + export async function deleteSession() { (await cookies()).delete('session'); } diff --git a/app/(protected)/dashboard/_apis/messages.ts b/app/(protected)/dashboard/_apis/messages.ts index d09aac7..188eef5 100644 --- a/app/(protected)/dashboard/_apis/messages.ts +++ b/app/(protected)/dashboard/_apis/messages.ts @@ -5,6 +5,7 @@ import { IMessage } from '@/app/_lib/_interfaces/IMessage'; export const getRoomMessages = async (roomId: string) => { try { const res = await myAxios.get(`/api/v1/chat/rooms/${roomId}/messages`); + console.log('Fetched room messages:', res.data); return res.data; } catch (error) { console.error('Error fetching room messages:', error); diff --git a/app/_components/AsideDashboard.tsx b/app/_components/AsideDashboard.tsx index d359afc..dbb8879 100644 --- a/app/_components/AsideDashboard.tsx +++ b/app/_components/AsideDashboard.tsx @@ -47,17 +47,15 @@ export default function AsideDashboard() {
-
- + {/* image of user -
-

{user?.displayName}

-
+ /> */} +

{user?.displayName}