'use client' import { useState } from 'react' import { useRouter } from 'next/navigation' import Link from 'next/link' import { signIn } from '@/lib/auth-actions' import { Button } from '@/components/ui/button' import { Input} from '@/components/ui/input' import { Label } from '@/components/ui/label' 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 handleEmailLogin(e: React.FormEvent) { e.preventDefault() setError('') setLoading(true) const result = await signIn(email, password) if (result.error) { setError(result.error) setLoading(false) } else { router.push('/dashboard') router.refresh() } } async function handleOAuthLogin(provider: 'github' | 'google') { const supabase = createClient() const { error } = await supabase.auth.signInWithOAuth({ provider, options: { redirectTo: `${window.location.origin}/auth/callback`, }, }) if (error) { setError(error.message) } } return (

{'{'}hackerspace.sh{'}'}

Sign in to your space

setEmail(e.target.value)} className="mt-2 bg-black/40 border-gray-800 text-white" required />
setPassword(e.target.value)} className="mt-2 bg-black/40 border-gray-800 text-white" required />
{error && (
{error}
)}
or

no account?{' '} create or join a space →

) }