Sending Verification Email with OTP Code

Overview

This article explains how a user’s email address can be verified with a One-Time Password (OTP) instead of a standard verification link.

Applies To

  • Verification Email
  • OTP Code

Solution

This functionality is not supported out of the box. The recommended method is to use the Verification Email (using Link) template to verify users.

However, a custom solution can be implemented as a workaround. This approach requires building the logic to issue and validate the code. The core components of this workaround include:

  • A custom service to generate and store the OTP, and to validate the code the user enters.
  • A call to the Management API to update the user’s email verification status after a successful code entry.
  • A Post-Login Action that prevents users from completing the login process until their email address has been successfully verified with the OTP.