Enforce Mandatory OTP in Controllers
masterIf config.otp_mandatory is enabled, you must ensure users are redirected to the enrollment form. Use the ensure_mandatory_{scope}_otp! method in your controllers. This works similarly to authenticate_{scope}!. It is best used as a before_action alongside your standard authentication check.
class ApplicationController < ActionController::Base
before_action :authenticate_user!
before_action :ensure_mandatory_user_otp!
end