forked from cardosofelipe/fast-next-template
Refactor auth hooks and add database existence check during migrations
- Consolidated `useAuthStore` into the unified `useAuth` hook for cleaner imports and consistency across frontend components. - Enhanced database management in Alembic migrations by introducing `ensure_database_exists` to automatically create the database if missing.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
|
||||
import Link from 'next/link';
|
||||
import { usePathname } from 'next/navigation';
|
||||
import { useAuthStore } from '@/lib/stores/authStore';
|
||||
import { useAuth } from '@/lib/stores';
|
||||
import { useLogout } from '@/lib/api/hooks/useAuth';
|
||||
import {
|
||||
DropdownMenu,
|
||||
@@ -67,7 +67,7 @@ function NavLink({
|
||||
}
|
||||
|
||||
export function Header() {
|
||||
const { user } = useAuthStore();
|
||||
const { user } = useAuth();
|
||||
const { mutate: logout, isPending: isLoggingOut } = useLogout();
|
||||
|
||||
const handleLogout = () => {
|
||||
|
||||
Reference in New Issue
Block a user