'use client' import { useState } from 'react' import { useRouter } from 'next/navigation' import Link from 'next/link' import { createClient } from '@/lib/supabase/client' export default function LoginPage() { const router = useRouter() const [email, setEmail] = useState('') const [password, setPassword] = useState('') const [error, setError] = useState('') const [loading, setLoading] = useState(false) async function handleSubmit(e: React.FormEvent) { e.preventDefault() setLoading(true) setError('') const supabase = createClient() const { error } = await supabase.auth.signInWithPassword({ email, password }) if (error) { setError(error.message) setLoading(false) } else { router.push('/dashboard') router.refresh() } } return (
Sign in to your space
no account?{' '} create or join a space →