feat: update login footer, replace sign-up page, remove sign-up success page
Modify footer link, replace sign-up with invite notice, delete sign-up success page. Co-authored-by: ASOwnerYT <[email protected]>
This commit is contained in:
@@ -191,13 +191,14 @@ export default function LoginPage() {
|
|||||||
|
|
||||||
{/* Footer */}
|
{/* Footer */}
|
||||||
<p className="text-center text-sm text-muted-foreground mt-6">
|
<p className="text-center text-sm text-muted-foreground mt-6">
|
||||||
Don't have an account?{' '}
|
Need an account?{' '}
|
||||||
<Link
|
<a
|
||||||
href="/auth/sign-up"
|
href="mailto:[email protected]"
|
||||||
className="text-primary hover:underline font-medium"
|
className="text-primary hover:underline font-medium"
|
||||||
>
|
>
|
||||||
Sign up
|
Contact us
|
||||||
</Link>
|
</a>
|
||||||
|
{' '}to request access.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,55 +0,0 @@
|
|||||||
import Link from 'next/link'
|
|
||||||
import { Mail, ArrowLeft } from 'lucide-react'
|
|
||||||
import { Button } from '@/components/ui/button'
|
|
||||||
|
|
||||||
export default function SignUpSuccessPage() {
|
|
||||||
return (
|
|
||||||
<div className="min-h-screen bg-background flex items-center justify-center p-4">
|
|
||||||
{/* Background elements */}
|
|
||||||
<div className="absolute inset-0 overflow-hidden pointer-events-none">
|
|
||||||
<div className="absolute top-1/4 left-1/4 w-96 h-96 bg-primary/5 rounded-full blur-3xl" />
|
|
||||||
<div className="absolute bottom-1/4 right-1/4 w-96 h-96 bg-primary/5 rounded-full blur-3xl" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="relative w-full max-w-md">
|
|
||||||
{/* Back to home */}
|
|
||||||
<Link
|
|
||||||
href="/"
|
|
||||||
className="inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors mb-8"
|
|
||||||
>
|
|
||||||
<ArrowLeft className="w-4 h-4" />
|
|
||||||
Back to home
|
|
||||||
</Link>
|
|
||||||
|
|
||||||
{/* Card */}
|
|
||||||
<div className="bg-card border border-border rounded-2xl p-8 text-center">
|
|
||||||
{/* Icon */}
|
|
||||||
<div className="w-16 h-16 bg-primary/10 rounded-full flex items-center justify-center mx-auto mb-6">
|
|
||||||
<Mail className="w-8 h-8 text-primary" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Content */}
|
|
||||||
<h1 className="text-2xl font-bold mb-2">Check your email</h1>
|
|
||||||
<p className="text-muted-foreground mb-6">
|
|
||||||
We've sent you a confirmation link. Please check your email and click the link to verify your account.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
{/* Actions */}
|
|
||||||
<div className="space-y-3">
|
|
||||||
<Button asChild className="w-full h-12 bg-primary hover:bg-primary/90 text-primary-foreground">
|
|
||||||
<Link href="/auth/login">
|
|
||||||
Back to sign in
|
|
||||||
</Link>
|
|
||||||
</Button>
|
|
||||||
<p className="text-xs text-muted-foreground">
|
|
||||||
Didn't receive the email? Check your spam folder or{' '}
|
|
||||||
<Link href="/auth/sign-up" className="text-primary hover:underline">
|
|
||||||
try again
|
|
||||||
</Link>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
+30
-200
@@ -1,68 +1,8 @@
|
|||||||
'use client'
|
|
||||||
|
|
||||||
import { createClient } from '@/lib/supabase/client'
|
|
||||||
import { Button } from '@/components/ui/button'
|
|
||||||
import { Input } from '@/components/ui/input'
|
|
||||||
import { Label } from '@/components/ui/label'
|
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import { useRouter } from 'next/navigation'
|
import { ArrowLeft, Mail, Lock } from 'lucide-react'
|
||||||
import { useState } from 'react'
|
import { Button } from '@/components/ui/button'
|
||||||
import { Mail, Lock, Loader2, ArrowLeft, User } from 'lucide-react'
|
|
||||||
|
|
||||||
export default function SignUpPage() {
|
export default function SignUpPage() {
|
||||||
const [name, setName] = useState('')
|
|
||||||
const [email, setEmail] = useState('')
|
|
||||||
const [password, setPassword] = useState('')
|
|
||||||
const [error, setError] = useState<string | null>(null)
|
|
||||||
const [isLoading, setIsLoading] = useState(false)
|
|
||||||
const [isGoogleLoading, setIsGoogleLoading] = useState(false)
|
|
||||||
const router = useRouter()
|
|
||||||
|
|
||||||
const handleSignUp = async (e: React.FormEvent) => {
|
|
||||||
e.preventDefault()
|
|
||||||
const supabase = createClient()
|
|
||||||
setIsLoading(true)
|
|
||||||
setError(null)
|
|
||||||
|
|
||||||
try {
|
|
||||||
const { error } = await supabase.auth.signUp({
|
|
||||||
email,
|
|
||||||
password,
|
|
||||||
options: {
|
|
||||||
emailRedirectTo: `${window.location.origin}/auth/callback`,
|
|
||||||
data: {
|
|
||||||
full_name: name,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
if (error) throw error
|
|
||||||
router.push('/auth/sign-up-success')
|
|
||||||
} catch (error: unknown) {
|
|
||||||
setError(error instanceof Error ? error.message : 'An error occurred')
|
|
||||||
} finally {
|
|
||||||
setIsLoading(false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleGoogleSignUp = async () => {
|
|
||||||
const supabase = createClient()
|
|
||||||
setIsGoogleLoading(true)
|
|
||||||
setError(null)
|
|
||||||
|
|
||||||
try {
|
|
||||||
const { error } = await supabase.auth.signInWithOAuth({
|
|
||||||
provider: 'google',
|
|
||||||
options: {
|
|
||||||
redirectTo: `${window.location.origin}/auth/callback`,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
if (error) throw error
|
|
||||||
} catch (error: unknown) {
|
|
||||||
setError(error instanceof Error ? error.message : 'An error occurred')
|
|
||||||
setIsGoogleLoading(false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen bg-background flex items-center justify-center p-4">
|
<div className="min-h-screen bg-background flex items-center justify-center p-4">
|
||||||
{/* Background elements */}
|
{/* Background elements */}
|
||||||
@@ -82,150 +22,40 @@ export default function SignUpPage() {
|
|||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
{/* Card */}
|
{/* Card */}
|
||||||
<div className="bg-card border border-border rounded-2xl p-8">
|
<div className="bg-card border border-border rounded-2xl p-8 text-center">
|
||||||
{/* Header */}
|
{/* Logo */}
|
||||||
<div className="text-center mb-8">
|
<Link href="/" className="inline-block mb-6">
|
||||||
<Link href="/" className="inline-block mb-6">
|
<span className="text-2xl font-bold">
|
||||||
<span className="text-2xl font-bold">
|
Cloud<span className="text-primary">rite</span>
|
||||||
Cloud<span className="text-primary">rite</span>
|
</span>
|
||||||
</span>
|
</Link>
|
||||||
</Link>
|
|
||||||
<h1 className="text-2xl font-bold mb-2">Create an account</h1>
|
{/* Icon */}
|
||||||
<p className="text-muted-foreground">
|
<div className="mx-auto w-16 h-16 rounded-2xl bg-primary/10 flex items-center justify-center mb-6">
|
||||||
Get started with Cloudrite today
|
<Lock className="w-8 h-8 text-primary" />
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Google OAuth Button */}
|
<h1 className="text-2xl font-bold mb-3">Invite Only</h1>
|
||||||
|
<p className="text-muted-foreground mb-2">
|
||||||
|
Account creation is by invitation only.
|
||||||
|
</p>
|
||||||
|
<p className="text-muted-foreground mb-8">
|
||||||
|
To request access, please get in touch with us and we'll get you set up.
|
||||||
|
</p>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
asChild
|
||||||
variant="outline"
|
className="w-full h-12 bg-primary hover:bg-primary/90 text-primary-foreground mb-4"
|
||||||
className="w-full h-12 mb-6 relative"
|
|
||||||
onClick={handleGoogleSignUp}
|
|
||||||
disabled={isGoogleLoading}
|
|
||||||
>
|
>
|
||||||
{isGoogleLoading ? (
|
<a href="mailto:[email protected]" className="flex items-center justify-center gap-2">
|
||||||
<Loader2 className="w-5 h-5 animate-spin" />
|
<Mail className="w-4 h-4" />
|
||||||
) : (
|
contact@cloudrite.co.nz
|
||||||
<>
|
</a>
|
||||||
<svg className="w-5 h-5 mr-2" viewBox="0 0 24 24">
|
|
||||||
<path
|
|
||||||
fill="currentColor"
|
|
||||||
d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
fill="currentColor"
|
|
||||||
d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
fill="currentColor"
|
|
||||||
d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
fill="currentColor"
|
|
||||||
d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
Continue with Google
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
{/* Divider */}
|
<Button asChild variant="outline" className="w-full h-12">
|
||||||
<div className="relative mb-6">
|
<Link href="/auth/login">Back to sign in</Link>
|
||||||
<div className="absolute inset-0 flex items-center">
|
</Button>
|
||||||
<div className="w-full border-t border-border" />
|
|
||||||
</div>
|
|
||||||
<div className="relative flex justify-center text-xs uppercase">
|
|
||||||
<span className="bg-card px-2 text-muted-foreground">
|
|
||||||
Or continue with email
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Email/Password Form */}
|
|
||||||
<form onSubmit={handleSignUp} className="space-y-4">
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Label htmlFor="name">Full Name</Label>
|
|
||||||
<div className="relative">
|
|
||||||
<User className="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground" />
|
|
||||||
<Input
|
|
||||||
id="name"
|
|
||||||
type="text"
|
|
||||||
placeholder="John Doe"
|
|
||||||
required
|
|
||||||
value={name}
|
|
||||||
onChange={(e) => setName(e.target.value)}
|
|
||||||
className="pl-10 h-12"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Label htmlFor="email">Email</Label>
|
|
||||||
<div className="relative">
|
|
||||||
<Mail className="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground" />
|
|
||||||
<Input
|
|
||||||
id="email"
|
|
||||||
type="email"
|
|
||||||
placeholder="[email protected]"
|
|
||||||
required
|
|
||||||
value={email}
|
|
||||||
onChange={(e) => setEmail(e.target.value)}
|
|
||||||
className="pl-10 h-12"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Label htmlFor="password">Password</Label>
|
|
||||||
<div className="relative">
|
|
||||||
<Lock className="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground" />
|
|
||||||
<Input
|
|
||||||
id="password"
|
|
||||||
type="password"
|
|
||||||
placeholder="Create a password"
|
|
||||||
required
|
|
||||||
minLength={6}
|
|
||||||
value={password}
|
|
||||||
onChange={(e) => setPassword(e.target.value)}
|
|
||||||
className="pl-10 h-12"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<p className="text-xs text-muted-foreground">
|
|
||||||
Must be at least 6 characters
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{error && (
|
|
||||||
<div className="p-3 bg-destructive/10 border border-destructive/50 rounded-lg">
|
|
||||||
<p className="text-sm text-destructive">{error}</p>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<Button
|
|
||||||
type="submit"
|
|
||||||
className="w-full h-12 bg-primary hover:bg-primary/90 text-primary-foreground"
|
|
||||||
disabled={isLoading}
|
|
||||||
>
|
|
||||||
{isLoading ? (
|
|
||||||
<Loader2 className="w-5 h-5 animate-spin" />
|
|
||||||
) : (
|
|
||||||
'Create account'
|
|
||||||
)}
|
|
||||||
</Button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
{/* Footer */}
|
|
||||||
<p className="text-center text-sm text-muted-foreground mt-6">
|
|
||||||
Already have an account?{' '}
|
|
||||||
<Link
|
|
||||||
href="/auth/login"
|
|
||||||
className="text-primary hover:underline font-medium"
|
|
||||||
>
|
|
||||||
Sign in
|
|
||||||
</Link>
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user