From 5045e0797085dc783f9ab0e6b915636bd5a4561d Mon Sep 17 00:00:00 2001 From: Mustafa Date: Thu, 30 Jul 2026 12:36:37 +0300 Subject: [PATCH] chore: remove next-auth, use simple auth --- app/[locale]/admin/login/page.tsx | 29 ++++---------- app/api/auth/[...nextauth]/route.ts | 11 +++++- lib/auth-helpers.ts | 8 +--- lib/auth.ts | 60 +---------------------------- package.json | 2 - proxy.ts | 16 +------- 6 files changed, 21 insertions(+), 105 deletions(-) diff --git a/app/[locale]/admin/login/page.tsx b/app/[locale]/admin/login/page.tsx index 55c43c5..c7c43f4 100644 --- a/app/[locale]/admin/login/page.tsx +++ b/app/[locale]/admin/login/page.tsx @@ -1,13 +1,11 @@ 'use client' import { useState } from 'react' -import { signIn } from 'next-auth/react' import { useRouter } from 'next/navigation' import Image from 'next/image' export default function AdminLoginPage() { const router = useRouter() - const [email, setEmail] = useState('') const [password, setPassword] = useState('') const [error, setError] = useState('') const [loading, setLoading] = useState(false) @@ -17,17 +15,14 @@ export default function AdminLoginPage() { setLoading(true) setError('') - const result = await signIn('credentials', { - email, - password, - redirect: false, - }) - - if (result?.error) { - setError('Email veya şifre hatalı.') - setLoading(false) - } else { + // Basit şifre kontrolü — ileride API'ye bağlanabilir + const adminPass = process.env.NEXT_PUBLIC_ADMIN_PASSWORD || 'vesta2025' + if (password === adminPass) { + sessionStorage.setItem('admin_auth', '1') router.push('/tr/admin') + } else { + setError('Şifre hatalı.') + setLoading(false) } } @@ -46,16 +41,6 @@ export default function AdminLoginPage() {
-
- setEmail(e.target.value)} - placeholder="Email" - required - className="w-full bg-white/10 border border-white/10 rounded-xl px-4 py-3 text-white placeholder:text-white/30 focus:outline-none focus:ring-2 focus:ring-vesta-earth/50" - /> -