UsersModelUser::isValidSecretKey

Checks if the provided secret key is a valid two factor authentication secret key. If not, it will check it against the list of one time emergency passwords (OTEPs). If it's a valid OTEP it will also remove it from the user's list of OTEPs.

This method will return true in the following conditions: - The two factor authentication is not enabled - You have provided a valid secret key for - You have provided a valid OTEP You can define the following options in the $options array: otp_config The OTP (one time password, a.k.a. two factor auth) configuration object. If not set we'll load it automatically. warn_if_not_req Issue a warning if you are checking a secret key against a user account which doesn't have any two factor authentication method enabled. warn_irq_msg The string to use for the warn_if_not_req warning