Email Verification
When enabled, new users receive a verification email after registration. They cannot log in until their email is confirmed.
Enable verification
Section titled “Enable verification”In your project’s auth settings (dashboard → Auth → Configuration), toggle Require email verification. Once enabled, signUp returns requiresVerification: true and no token is issued.
Handle in your app
Section titled “Handle in your app”import { useAuth } from '@aerostack/react'
function RegisterFlow() { const { signUp } = useAuth() const [needsVerification, setNeedsVerification] = useState(false)
const handleRegister = async () => { const result = await signUp(email, password, { name }) if (result.requiresVerification) { setNeedsVerification(true) } }
if (needsVerification) { return <VerificationPending email={email} /> } // ...}Verify from email link
Section titled “Verify from email link”The verification link in the email points to your app with a ?token= query param. Handle it:
// In your /verify-email pageimport { useAuth } from '@aerostack/react'import { useSearchParams } from 'react-router-dom'
function VerifyEmailPage() { const { verifyEmail } = useAuth() const [params] = useSearchParams()
useEffect(() => { const token = params.get('token') if (token) { verifyEmail(token).then(() => { // Email verified — redirect to app }) } }, [])}GET /v1/public/projects/{slug}/auth/verify-email?token={token}
# Response: 200 OK{ "message": "Email verified successfully" }Resend verification email
Section titled “Resend verification email”const { resendVerificationEmail } = useAuth()
await resendVerificationEmail('user@example.com')Configure the verification email
Section titled “Configure the verification email”The verification email template (sender name, subject, body) is configurable in your project dashboard under Auth → Email Templates.