feat: dashboard setup with passkey authentication
Scaffold Vite + React + TypeScript project with Tailwind CSS dark theme. Add Axios API client with JWT interceptor and auto-refresh, WebAuthn passkey auth flow (register/login), protected route wrapper, and React Router with public and protected routes.
This commit is contained in:
parent
f218865872
commit
f121f376ae
20 changed files with 5274 additions and 0 deletions
16
dashboard/src/components/ProtectedRoute.tsx
Normal file
16
dashboard/src/components/ProtectedRoute.tsx
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import type { ReactNode } from 'react';
|
||||
import { Navigate } from 'react-router-dom';
|
||||
|
||||
interface ProtectedRouteProps {
|
||||
children: ReactNode;
|
||||
}
|
||||
|
||||
export function ProtectedRoute({ children }: ProtectedRouteProps) {
|
||||
const token = localStorage.getItem('access_token');
|
||||
|
||||
if (!token) {
|
||||
return <Navigate to="/login" replace />;
|
||||
}
|
||||
|
||||
return <>{children}</>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue