Refactor UI imports and update component paths
Some checks failed
Build Frontend / build (push) Failing after 7s

Replaces imports from 'components/ui' with 'components/common' across the app and dashboard pages, and updates model and API imports to use new paths under 'lib'. Removes redundant authentication checks from several dashboard pages. Adds new dashboard components and utility files, and reorganizes hooks and services into the 'lib' directory for improved structure.
This commit is contained in:
g
2026-01-13 05:02:13 +00:00
parent a6e6cd0757
commit fe01f31538
173 changed files with 1512 additions and 867 deletions

25
middleware.ts Normal file
View File

@@ -0,0 +1,25 @@
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';
export function middleware(request: NextRequest) {
const { pathname } = request.nextUrl;
// Protect dashboard routes
if (pathname.startsWith('/dashboard')) {
const authToken = request.cookies.get('Authorization')?.value;
if (!authToken) {
// Redirect to login if no token is found
const loginUrl = new URL('/auth/login', request.url);
loginUrl.searchParams.set('redirectUrl', pathname);
return NextResponse.redirect(loginUrl);
}
}
return NextResponse.next();
}
// See "Matching Paths" below to learn more
export const config = {
matcher: ['/dashboard/:path*'],
};