Files
imphnen-frontend-service/libs/utils/src/hooks/use-session.ts
T
Maulana SodiqinandClaude c385aa1996 fix(hackathon): remove Supabase dependencies completely
- Remove Supabase export from service library
- Update forgot-password and reset-password pages to use backend API
- Update layout.tsx to use useAuthStore instead of Supabase session
- Update sidebar logout to not use Supabase
- Update middleware to use SessionUser instead of Supabase
- Update use-session hook to remove Supabase dependency

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 15:57:30 +07:00

21 lines
467 B
TypeScript

import { useAuthStore } from '@imphnen-frontend-service/service';
import { useNavigate } from 'react-router';
export const useSession = () => {
const navigate = useNavigate();
const { clearSession, session, status } = useAuthStore();
const isAuthenticated = status === 'authenticated';
const signOut = () => {
clearSession();
localStorage.clear();
navigate('/auth/login');
};
return {
session,
signOut,
isAuthenticated,
};
};