Skip to main content
Glama
page.tsx3.03 kB
'use client' import { useState } from 'react' import { createClient } from '@/lib/supabase/client' import Link from 'next/link' import { useRouter } from 'next/navigation' export default function LoginPage() { const [email, setEmail] = useState('') const [password, setPassword] = useState('') const [loading, setLoading] = useState(false) const [error, setError] = useState<string | null>(null) const router = useRouter() const handleLogin = async (e: React.FormEvent) => { e.preventDefault() setLoading(true) setError(null) try { const supabase = createClient() const { error: signInError } = await supabase.auth.signInWithPassword({ email, password, }) if (signInError) throw signInError // Redirect to dashboard after successful login router.push('/') router.refresh() } catch (err) { setError(err instanceof Error ? err.message : 'An error occurred') } finally { setLoading(false) } } return ( <div className="min-h-screen flex items-center justify-center bg-gray-50 py-12 px-4"> <div className="max-w-md w-full space-y-8"> <div className="text-center"> <h1 className="text-2xl font-bold text-blue-600">Hostaway MCP Dashboard</h1> <h2 className="mt-4 text-3xl font-extrabold text-gray-900">Sign in to your account</h2> <p className="mt-2 text-sm text-gray-600">Manage your property management automation</p> </div> <form className="mt-8 space-y-6" onSubmit={handleLogin}> {error && <div className="rounded-md bg-red-50 p-4 text-sm text-red-700">{error}</div>} <div className="space-y-4"> <input type="email" required className="appearance-none relative block w-full px-3 py-2 border border-gray-300 rounded-md" placeholder="Email" value={email} onChange={(e) => setEmail(e.target.value)} disabled={loading} /> <input type="password" required className="appearance-none relative block w-full px-3 py-2 border border-gray-300 rounded-md" placeholder="Password" value={password} onChange={(e) => setPassword(e.target.value)} disabled={loading} /> </div> <button type="submit" disabled={loading} className="w-full py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 disabled:opacity-50" > {loading ? 'Signing in...' : 'Sign in'} </button> <p className="text-center text-sm text-gray-600"> Don&apos;t have an account?{' '} <Link href="/signup" className="font-medium text-blue-600 hover:text-blue-500"> Sign up </Link> </p> </form> </div> </div> ) }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/darrentmorgan/hostaway-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server