Security, Users & Multilingual

Enabling Email 2FA, Social Login (OAuth), Google reCAPTCHA v3, and Database SSL

Published 2026-12-04 03:20:21

Email Two-Factor Authentication (2FA)

Enable Login 2FA (enable_login_2fa) and/or Checkout 2FA (enable_checkout_2fa) under Admin → Settings → Shop Settings:

  • Sends a cryptographically secure 6-digit code via the translatable two_factor_verification email template (valid for 15 minutes with a 45-second resend cooldown).
  • Smart UX Hardening: Built-in cooldown idempotency prevents duplicate emails, a previous-code grace window keeps slightly delayed codes valid using timing-safe hash_equals(), pasted whitespace is stripped automatically, and passing Login 2FA satisfies Checkout 2FA for the session.
  • Automatic Exemptions: Social OAuth users are always exempt; returning users who logged in within 30 days are exempt from Login 2FA, and customers who placed an order within 30 days are exempt from Checkout 2FA.

Social Login (Google, Facebook & GitHub OAuth)

Add your OAuth credentials (GOOGLE_CLIENT_ID/SECRET, FACEBOOK_CLIENT_ID/SECRET, GITHUB_CLIENT_ID/SECRET) in .env and register callback URLs at https://yourdomain.com/auth/{provider}/callback. If a provider omits an email address, users are automatically guided through /collect-email. Guest carts merge automatically upon login.

Google reCAPTCHA v3

Protect registration, product reviews, CMS forms, guest ticket replies, and password-gated CMS pages by adding:

RECAPTCHA_SITE_KEY=your_site_key
RECAPTCHA_SECRET_KEY=your_secret_key
RECAPTCHA_THRESHOLD=0.5

Database SSL/TLS Encryption

For managed databases (AWS RDS, DigitalOcean, PlanetScale), configure SSL directly in .env using DB_SSL_CA (or MYSQL_ATTR_SSL_CA), DB_SSL_CERT, DB_SSL_KEY, DB_SSL_CIPHER, and DB_SSL_VERIFY=true. Note also that optional legacy RIPEMD password hashing checks lowercase custom_login_security=enabled on case-sensitive Linux servers.

Was this article helpful?

Let us know how we can improve our documentation.