File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ export default function ProtectedRoute({
2222 allowedRoles &&
2323 ! allowedRoles . some ( ( role ) => user . roles . includes ( role ) )
2424 ) {
25- return < Navigate to = "/login " replace /> ;
25+ return < Navigate to = "/unauthorized " replace /> ;
2626 }
2727
2828 return children ;
Original file line number Diff line number Diff line change 1+ import { Link } from 'react-router-dom' ;
2+
3+ export default function Unauthorized ( ) {
4+ return (
5+ < div className = "flex min-h-screen flex-col items-center justify-center px-6 text-center" >
6+ < h1 className = "text-3xl font-bold" > 403 - Unauthorized</ h1 >
7+
8+ < p className = "mt-2 text-muted-foreground" >
9+ You do not have permission to access this page.
10+ </ p >
11+
12+ < Link to = "/" className = "mt-4 text-primary underline" >
13+ Go back home
14+ </ Link >
15+ </ div >
16+ ) ;
17+ }
18+
19+
20+
You can’t perform that action at this time.
0 commit comments