//! Handlers triggered by clicking email links, plus the forms that initiate them. mod account; mod links; mod password; use axum::{routing::get, Router}; use tower_governor::GovernorLayer; use crate::{constants, helpers::rate_limiter_ms, AppState}; /// Register email action routes. pub fn email_action_routes() -> Router { let auth_rate_limit = rate_limiter_ms(constants::AUTH_RATE_LIMIT_MS, constants::AUTH_RATE_LIMIT_BURST); Router::new() .route( "/forgot-password", get(password::forgot_password_page) .post(password::forgot_password_handler) .route_layer(GovernorLayer { config: auth_rate_limit, }), ) .route( "/reset-password", get(password::reset_password_page).post(password::reset_password_handler), ) .route("/verify-email", get(links::verify_email_handler)) .route("/login-link", get(links::login_link_handler)) .route( "/confirm-delete", get(account::confirm_delete_page).post(account::confirm_delete_handler), ) .route( "/unsubscribe", get(account::unsubscribe_page).post(account::unsubscribe_handler), ) }