Spaces:
Sleeping
Sleeping
FauziIsyrinApridal commited on
Commit ·
ad3e6a0
1
Parent(s): ecde7b2
revisi 14
Browse files- app/(auth)/login/page.tsx +21 -1
app/(auth)/login/page.tsx
CHANGED
|
@@ -4,7 +4,11 @@ import PnpLogo from "../../../public/logo-pnp.webp";
|
|
| 4 |
import { redirect } from "next/navigation";
|
| 5 |
import { createClient } from "@/utils/supabase/server";
|
| 6 |
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
const supabase = createClient();
|
| 9 |
|
| 10 |
const {
|
|
@@ -30,6 +34,22 @@ export default async function Login() {
|
|
| 30 |
Selamat Datang di Situs Manajemen Data Chatbot Politeknik Negeri
|
| 31 |
Padang
|
| 32 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
<SignInForm />
|
| 34 |
</div>
|
| 35 |
</div>
|
|
|
|
| 4 |
import { redirect } from "next/navigation";
|
| 5 |
import { createClient } from "@/utils/supabase/server";
|
| 6 |
|
| 7 |
+
interface LoginProps {
|
| 8 |
+
searchParams: { error?: string };
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
export default async function Login({ searchParams }: LoginProps) {
|
| 12 |
const supabase = createClient();
|
| 13 |
|
| 14 |
const {
|
|
|
|
| 34 |
Selamat Datang di Situs Manajemen Data Chatbot Politeknik Negeri
|
| 35 |
Padang
|
| 36 |
</p>
|
| 37 |
+
|
| 38 |
+
{/* Warning message for not_admin error */}
|
| 39 |
+
{searchParams.error === "not_admin" && (
|
| 40 |
+
<div className="mb-4 rounded-md border border-red-300 bg-red-50 p-3 text-sm text-red-700">
|
| 41 |
+
<div className="flex items-center">
|
| 42 |
+
<svg className="mr-2 h-4 w-4" fill="currentColor" viewBox="0 0 20 20">
|
| 43 |
+
<path fillRule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clipRule="evenodd" />
|
| 44 |
+
</svg>
|
| 45 |
+
<strong>Akses Ditolak:</strong>
|
| 46 |
+
</div>
|
| 47 |
+
<p className="mt-1">
|
| 48 |
+
Anda tidak memiliki hak akses admin. Silakan hubungi administrator untuk mendapatkan akses ke sistem ini.
|
| 49 |
+
</p>
|
| 50 |
+
</div>
|
| 51 |
+
)}
|
| 52 |
+
|
| 53 |
<SignInForm />
|
| 54 |
</div>
|
| 55 |
</div>
|