Confirms a user’s email address using a token or code
This process ensures that the person registering or using an email address actually has access to it. When a user registers a new account or adds a new email address to their profile, the system sends a confirmation email containing either a token (a long, randomly generated string) or a numerical code. This function processes the verification when the user clicks the confirmation link in the email or manually enters the provided code. It accepts either:
a) A token parameter, which is included in the confirmation link
b) A code parameter, which is a shorter numerical sequence that can be manually entered