Files
Andrew S Erwin e8f04a4082
release gate / check (push) Canceled after 2m9s
Brand icon: replace the LinkOS-era placeholders with the real Superbrain mark
The favicon was a purple block placeholder and og-image.png still said
"LinkOS — Connect Everything"; every brand surface (sidebar, login,
signup, forgot/reset password, unsubscribe) drew a generic Link2 glyph in
a primary-colored square instead of the logo.

Assets (from the operator's superbrain-icon.svg/png):
- public/favicon.svg: the real mark, with the multi-KB C2PA provenance
  manifest stripped (graphics, gradients and filters verified intact via
  rsvg-convert at tab size).
- public/superbrain-icon.png: the 1024px RGBA asset; also wired as the
  apple-touch icon in the root metadata.
- public/og-image.png: recomposed 1200x630 banner — mark + Superbrain
  wordmark + tagline on the brand's deep-blue gradient.

Surfaces: new components/brand-icon.tsx is the single source for the mark
(one img, transparent rounded corners); sidebar brand, all auth pages,
all three unsubscribe states and the help header now use it. State icons
(Check/BellOff) and unused Link2 imports removed where the mark replaced
them; Link2 stays where it is a nav glyph (All Bookmarks).

Verified: web lint/SSR-lint/build 0 errors; full browser regressions pass
(login, mobile shell overflow checks and sign-out flows included).
2026-11-21 23:52:28 -06:00

85 lines
3.5 KiB
TypeScript

'use client'
import { useState } from 'react'
import { signIn } from 'next-auth/react'
import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input'
import { Mail, Lock, User } from 'lucide-react'
import { BrandIcon } from '@/components/brand-icon'
import Link from 'next/link'
import { toast } from 'sonner'
import { useRouter } from 'next/navigation'
export function SignupClient() {
const [name, setName] = useState('')
const [email, setEmail] = useState('')
const [password, setPassword] = useState('')
const [loading, setLoading] = useState(false)
const router = useRouter()
const handleSignup = async (e: React.FormEvent) => {
e.preventDefault()
// Review M-8: match the server's 8-character minimum (and the input's
// minLength). The old 6-character check let a doomed request through.
if (password.length < 8) { toast.error('Password must be at least 8 characters'); return }
setLoading(true)
try {
const res = await fetch('/api/signup', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ email, password, name }),
})
const data = await res.json()
if (res.ok) {
// Auto sign in
const result = await signIn('credentials', { email, password, redirect: false })
if (result?.ok) {
router.push('/pages')
} else {
toast.success('Account created! Please sign in.')
router.push('/login')
}
} else {
toast.error(data?.error ?? 'Signup failed')
}
} catch {
toast.error('Error creating account')
}
setLoading(false)
}
return (
<div className="min-h-screen flex items-center justify-center bg-background p-4">
<div className="w-full max-w-sm space-y-8">
<div className="text-center">
<div className="flex justify-center mb-4">
<BrandIcon className="h-14 w-14" />
</div>
<h1 className="font-display text-3xl font-bold tracking-tight">Create Account</h1>
<p className="text-sm text-muted-foreground mt-2">Join Superbrain to start organizing your links</p>
</div>
<form onSubmit={handleSignup} className="space-y-3">
<div className="relative">
<User className="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" />
<Input placeholder="Name" value={name} onChange={(e: React.ChangeEvent<HTMLInputElement>) => setName(e.target.value)} className="pl-10" />
</div>
<div className="relative">
<Mail className="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" />
<Input type="email" placeholder="Email" value={email} onChange={(e: React.ChangeEvent<HTMLInputElement>) => setEmail(e.target.value)} className="pl-10" required />
</div>
<div className="relative">
<Lock className="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" />
<Input type="password" placeholder="Password (min 8 chars)" value={password} onChange={(e: React.ChangeEvent<HTMLInputElement>) => setPassword(e.target.value)} className="pl-10" minLength={8} required />
</div>
<Button type="submit" className="w-full" loading={loading}>Create Account</Button>
</form>
<p className="text-center text-xs text-muted-foreground">
Already have an account? <Link href="/login" className="text-primary hover:underline">Sign in</Link>
</p>
</div>
</div>
)
}