import { useSession } from 'h3';

export default defineEventHandler(async (event) => {
  const session = await useSession(event, {
    password: process.env.SESSION_PASSWORD,
  });

  await session.clear();

  return { message: 'Logged out successfully.' };
});
