How to verify user account?

How to verify user account if they create account using email?

Iā€™d suggest you use a 3rd party service to send your verification email using an after hook if the account was just created (created field in AuthenticateEmail result will be set to true).

To prevent the user from logging in until verification happens (or gating other features) you could use a before hook on AuthenticateEmail that uses the GetAccount API to check whether the account exists, if it does, check the verify time to see if the email was already verified, otherwise allow AuthenticateEmail to go through to set up the new account.

As for handling the verification, please see: Email Verification Status. The easiest would be to set up a separate server to receive the email verification token and then use a S2S server call to set the verify_time as described in the thread above.

Hope this helps.

1 Like