TagsLast updated: 20 January 2026
JCOGS OTP Pro provides template tags for implementing OTP workflows in ExpressionEngine templates.
Each tag has its own page with syntax, parameters, variables, and examples.
Login Form
Renders a login form with OTP Pro support. This tag is designed to support multi-step login flows where the member may need to enter an OTP code (or follow a magic link) after submitting their username/password.
Syntax + Examples
{exp:jcogs_otp_pro:login_form return="/account"}
Syntax
Parameters
returnβ redirect URL after successful login (optional)otp_returnβ redirect URL for OTP validation page (Pattern 2 flow; optional)form_idβ HTMLidattribute for the form (default:otp_login_form)form_classβ HTMLclassattribute for the form (default:otp-login-form)error_handlingβ currently reserved (default:inline)auto_load_assetsβyes/no; auto-includes the OTP Pro stylesheet from the theme folder (default:yes)
Syntax
Variables
form_open,form_closeβ the opening/closing form HTMLreturn_input,otp_return_inputβ hidden inputs for redirectsshow_otpβ whether the OTP step is currently being shown (set from flashdata)username,username_readonly,password_readonly,username_required,password_requiredrequires_code_deliveryβtrueif the selected transport requires sending a coderesend_action_urlβ URL to trigger a resend (when supported)delivery_method,transport_id,payload_id,provider_nameis_locked_out,attempts_remaining,lockout_minutes_remaining,lockout_message,warning_message,otp_input_disablederrorsβ variable pair containing{error}
Usage Notes
Conditionals
This tag provides a few convenience conditionals by rewriting specific markers in your tagdata. Use these exact conditionals in your template:
{if errors}...{/if}{if show_otp}...{/if}{if is_locked_out}...{/if}{if warning_message}...{/if}
Values:
Example
Setup Form
Renders the OTP setup form (for initial configuration). This tag supports authenticator-based setup (QR code + secret) and delivery-based setup (for example email), including optional backup code display.
Syntax + Examples
This tag posts to the OTP Pro setup action. Use a hidden return input inside the form (as in the sample templates) to control where the member is redirected.
Values:
Example
Status
Outputs the current memberβs OTP status and key configuration values. This is typically used to show βenabled/disabledβ state, the current delivery channel, and recent activity.
Syntax + Examples
{exp:jcogs_otp_pro:status}
Syntax
Variables
otp_enabledβy/notp_setup_completedβy/ndelivery_methodβ legacy delivery channel stringdelivery_method_name,delivery_method_displaytransport_id,payload_idenabled_date,enabled_timestamplast_validated,last_validated_formatted,last_validated_relativebackup_codes_count,has_backup_codes,backup_code_availabletrusted_device_countcan_enableβy/n
Values:
Example
Delivery Methods
Lists available delivery channels for the logged-in member and provides a ready-made form for switching.
Syntax + Examples
{exp:jcogs_otp_pro:delivery_methods}
Syntax
Variables
current_methodβ legacy delivery channel stringcurrent_transport_id,current_payload_idcurrent_method_nameprovidersβ variable pair with:{providers}fields:identifier,transport_id,payload_id,name,description,is_current,can_change_to, plus form helpersform_open,form_close,method_input,transport_input,payload_inputerrorsβ variable pair containing{error}successβ success message string (flashdata)
Values:
Example
Trusted Devices
Lists trusted devices and supports revocation.
Syntax + Examples
{exp:jcogs_otp_pro:trusted_devices}
Syntax
Variables
total_count,has_devicesrevoke_all_urlandrevoke_all_form_open/revoke_all_form_close/revoke_all_inputdevicesβ variable pair with:{devices}fields:device_id,device_name,trusted_at,trusted_at_formatted,expires_at,expires_at_formatted,last_used,last_used_formatted,ip_address,user_agent,is_current_device,can_revoke, plus revoke helpersrevoke_url,revoke_form_open,revoke_form_close,device_id_inputerrorsβ variable pair containing{error}successβ success message string (flashdata)
Values:
Example
Disable Form
Renders a form for members to disable OTP (where permitted).
Syntax + Examples
{exp:jcogs_otp_pro:disable_form}
Syntax
Variables
form_open,form_closerequire_password,show_warningmember_emailenabled_sincetrusted_device_counterrorsβ variable pair containing{error}
Values:
Example
Dialog
Displays the OTP validation dialog when OTP validation is required. This is primarily intended for flows where the member is already logged in but must validate OTP before continuing.
Syntax + Examples
{exp:jcogs_otp_pro:dialog}...{/exp:jcogs_otp_pro:dialog}
Syntax
Parameters:
returnβ URL to redirect to after validation (optional; may also be provided as a GET parameter)
Usage Notes
- If the member is not logged in, this tag outputs nothing.
- If OTP is not enabled for the member, this tag outputs nothing.
- If OTP is already validated and a
returnURL is present, the tag redirects.
Action URL
Outputs an action URL for JCOGS OTP Pro actions (useful for custom forms and AJAX requests).
Syntax + Examples
{exp:jcogs_otp_pro:action_url action="..."}
Syntax
Parameters
action– the action name to generate a URL for (required)
Supported actions
loginvalidatesetupdisablechange_deliveryrevoke_device
Values:
Example
Get Error
Outputs the most recent OTP Pro error message (for example, after redirects).
Syntax + Examples
{exp:jcogs_otp_pro:get_error}
Syntax
Usage
- As a tag pair: exposes
{error}and{has_error} - As a single variable:
{exp:jcogs_otp_pro:get_error:error}
Values:
Example
Ajax Login Inline
Implements an AJAX login flow with inline progressive reveal UX.
Syntax + Examples
{exp:jcogs_otp_pro:ajax_login_inline return="/account"}
Syntax
Parameters
returnβ URL to redirect after successful login (default: site URL)form_idβ login form ID (default:otp-ajax-login-inline)form_classβ additional CSS classes (default:otp-form)show_remember_deviceβyes/no(default:yes)show_remember_loginβyes/no(default:yes)show_backup_codesβyes/no(default:yes)auto_load_assetsβyes/no(default:yes)
Usage Notes
- This tag outputs a self-contained HTML/JS login experience (it does not parse tagdata).
- It expects the OTP Pro theme assets to be available at
themes/user/jcogs_otp_pro/.
Ajax Login Modal
Implements an AJAX login flow with modal dialog UX.
Syntax + Examples
{exp:jcogs_otp_pro:ajax_login_modal return="/account" modal_title="Two-Factor Authentication"}
Syntax
Parameters
returnβ URL to redirect after successful login (default: site URL)form_idβ login form ID (default:otp-ajax-login-modal)form_classβ additional CSS classes (default:otp-form)show_remember_deviceβyes/no(default:yes)show_remember_loginβyes/no(default:yes)show_backup_codesβyes/no(default:yes)modal_titleβ modal heading text (default:Two-Factor Authentication)auto_load_assetsβyes/no(default:yes)
Usage Notes
- This tag outputs a self-contained HTML/JS login experience (it does not parse tagdata).
- Magic link payloads are handled by switching the modal into a βcheck your emailβ state.