From 700f1e2cbe9d19444ace1f8ada452b22fc67bd3d Mon Sep 17 00:00:00 2001
From: Dioxide <604834022@qq.com>
Date: Thu, 19 Jun 2025 15:35:33 +0800
Subject: [PATCH 1/2] Create the unauthorized page
---
src/app/(protected)/unauthorized/page.tsx | 28 +++++++++++++++++++++++
1 file changed, 28 insertions(+)
create mode 100644 src/app/(protected)/unauthorized/page.tsx
diff --git a/src/app/(protected)/unauthorized/page.tsx b/src/app/(protected)/unauthorized/page.tsx
new file mode 100644
index 0000000..52b0671
--- /dev/null
+++ b/src/app/(protected)/unauthorized/page.tsx
@@ -0,0 +1,28 @@
+'use client'
+
+import { Button } from "@/components/ui/button";
+import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
+import { redirect } from "next/navigation";
+
+
+export default function ForbiddenPage() {
+ const handleGoBack = () => {
+ redirect("/")
+ };
+
+ return (
+
+
+
+ 403
+
+
+ 你无权访问该页面
+
+
+
+
+ );
+}
From 8a6fedd928d1e5ebfe0f2aea29adb755877f9932 Mon Sep 17 00:00:00 2001
From: cfngc4594
Date: Thu, 19 Jun 2025 17:35:56 +0800
Subject: [PATCH 2/2] refactor(auth): Relocate unauthorized page
---
src/app/(auth)/unauthorized/page.tsx | 41 +++++++++++++++++++++++
src/app/(protected)/unauthorized/page.tsx | 28 ----------------
2 files changed, 41 insertions(+), 28 deletions(-)
create mode 100644 src/app/(auth)/unauthorized/page.tsx
delete mode 100644 src/app/(protected)/unauthorized/page.tsx
diff --git a/src/app/(auth)/unauthorized/page.tsx b/src/app/(auth)/unauthorized/page.tsx
new file mode 100644
index 0000000..1ccd41b
--- /dev/null
+++ b/src/app/(auth)/unauthorized/page.tsx
@@ -0,0 +1,41 @@
+"use client";
+
+import { useRouter } from "next/navigation";
+import { Button } from "@/components/ui/button";
+import { ArrowLeftIcon, HomeIcon } from "lucide-react";
+import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
+
+export default function UnauthorizedPage() {
+ const router = useRouter();
+
+ const handleGoBack = () => {
+ router.back();
+ };
+
+ const handleGoHome = () => {
+ router.push("/");
+ };
+
+ return (
+
+
+
+ 403
+
+
+ 你无权访问该页面
+
+
+
+
+ );
+}
diff --git a/src/app/(protected)/unauthorized/page.tsx b/src/app/(protected)/unauthorized/page.tsx
deleted file mode 100644
index 52b0671..0000000
--- a/src/app/(protected)/unauthorized/page.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-'use client'
-
-import { Button } from "@/components/ui/button";
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
-import { redirect } from "next/navigation";
-
-
-export default function ForbiddenPage() {
- const handleGoBack = () => {
- redirect("/")
- };
-
- return (
-
-
-
- 403
-
-
- 你无权访问该页面
-
-
-
-
- );
-}