Skip to content

Email Verification

When enabled, new users receive a verification email after registration. They cannot log in until their email is confirmed.

In your project’s auth settings (dashboard → Auth → Configuration), toggle Require email verification. Once enabled, signUp returns requiresVerification: true and no token is issued.

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} />
}
// ...
}

The verification link in the email points to your app with a ?token= query param. Handle it:

// In your /verify-email page
import { 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
})
}
}, [])
}
const { resendVerificationEmail } = useAuth()
await resendVerificationEmail('user@example.com')

The verification email template (sender name, subject, body) is configurable in your project dashboard under Auth → Email Templates.