Skip to main content

send_verification

Function send_verification 

Source
pub async fn send_verification(
    state: &AppState,
    user_id: Uuid,
    address: &str,
) -> Result<(), HttpResponse>
Expand description

Mint a confirmation token for user_id and mail it to address.

Called from POST <base>/auth/register and from the resend endpoint. The Err is a ready-made response: a registration whose confirmation could not be sent has produced an account nobody can sign in to, so it is worth failing loudly rather than leaving somebody waiting for a message that was never going to arrive.