{!-- /** * JCOGS OTP Pro - User Preference: OTP Setup * =========================================== * * Two-factor authentication enrollment form. Allows users to enable OTP * using either authenticator app or email delivery method. Displays backup * codes after successful setup. * * Features: * - Choice between authenticator app or email * - QR code generation for authenticator setup * - Test email functionality * - Backup code generation and display * - Already-enabled state detection * * Template Group: jcogs_otp_pro_examples * Return URL: /jcogs_otp_pro_examples/user_otp_settings * CSS/JS Path: __CSS_JS_PATH__ (replaced during installation) * * @category ExpressionEngine Template * @package JCOGS OTP Pro * @author JCOGS Design * @copyright 2026 JCOGS Design * @license https://jcogs.net/add-ons/license/jcogs_otp_pro * @version 2.0.4 * @link https://JCOGS.net/ */ --} Two-Factor Authentication Setup - JCOGS OTP Pro

Two-Factor Authentication Setup

Add an extra layer of security to your account

{exp:jcogs_otp_pro:setup_form return="/jcogs_otp_pro_examples/user_otp_settings" show_backup_codes="yes"} {!-- Already enabled state --} {if already_setup}
✅ 2FA is Already Enabled

Your account is already protected with two-factor authentication.

Manage Settings

{if:else} {!-- Show backup codes after successful setup --} {!-- NOTE: Codes are only displayed when a NEW secret is generated: - Initial OTP setup - Switching TO authenticator (requires new QR scan) Codes are NOT shown when switching FROM authenticator to email because the secret remains unchanged and existing backup codes are still valid. --} {if display_backup_codes == 'yes'}
✅ Two-Factor Authentication Enabled!

Your account is now protected with 2FA.

⚠️ Save Your Backup Codes

These codes can be used if you lose access to your authenticator. Save them in a secure location!

{backup_codes} {code} {/backup_codes}
Go to OTP Settings
{if:else} {!-- Setup form --} {if errors}
Error {errors}
{error}
{/errors}
{/if} {form_open} {!-- CSRF token automatically included by form_open --} {!-- Delivery Method Selection --}

Choose Your Method

{!-- Conditional content based on delivery method --}

📱 Step 1: Scan QR Code

Open your authenticator app (Google Authenticator, Authy, Microsoft Authenticator, etc.) and scan the QR code below:

{if qr_code}
QR Code for 2FA Setup
Can't scan? Enter manually: {secret}
{/if}

🔐 Step 2: Verify Code

Enter the 6-digit code from your authenticator app (or email) to complete setup:

Enter the 6-digit code to verify and enable 2FA
{form_close} {/if} {/if} {/exp:jcogs_otp_pro:setup_form}
← Back to Manage Settings