- 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>
21 lines
467 B
TypeScript
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,
|
|
};
|
|
};
|