feat: implement Supabase database schema and core authentication flow with registration and login pages

This commit is contained in:
Poyraz Avsever
2026-05-07 11:11:15 +03:00
parent 4126b41064
commit 904375ea5c
21 changed files with 8832 additions and 127 deletions
+22 -8
View File
@@ -1,17 +1,28 @@
import { login, signup } from './actions'
import { login } from './actions'
import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input'
import { Label } from '@/components/ui/label'
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@/components/ui/card'
import Link from 'next/link'
import { ErrorToaster } from '@/components/error-toaster'
export default async function LoginPage({
searchParams,
}: {
searchParams: Promise<{ [key: string]: string | string[] | undefined }>
}) {
const resolvedParams = await searchParams;
const error = resolvedParams?.error;
const message = resolvedParams?.message;
export default function LoginPage() {
return (
<div className="flex items-center justify-center min-h-screen bg-background">
<div className="flex items-center justify-center min-h-screen bg-background p-4">
{error && message && <ErrorToaster message={String(message)} />}
<Card className="w-full max-w-md">
<CardHeader className="space-y-1">
<CardTitle className="text-2xl font-bold text-center">MindSpace</CardTitle>
<CardDescription className="text-center">
Hesabınıza giriş yapın veya yeni hesap oluşturun
Hesabınıza giriş yapın
</CardDescription>
</CardHeader>
<CardContent>
@@ -26,13 +37,16 @@ export default function LoginPage() {
<Input id="password" name="password" type="password" required />
</div>
</div>
<div className="flex flex-col space-y-2 mt-6">
<div className="flex flex-col space-y-4 mt-6">
<Button formAction={login} className="w-full">
Giriş Yap
</Button>
<Button formAction={signup} variant="outline" className="w-full">
Kayıt Ol
</Button>
<div className="text-center text-sm">
Hesabınız yok mu?{' '}
<Link href="/register" className="text-primary hover:underline">
Kayıt Ol
</Link>
</div>
</div>
</form>
</CardContent>