confirm-email 0.1.3

A Rust crate for creating URL‑safe, encrypted email confirmation tokens with configurable expiry (with precision to the second) and for validating them to retrieve the original email.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug)]
/// Defines the data to be encoded in the token
pub(super) struct Payload {
    #[serde(rename = "m")]
    /// Email address to verify
    pub(super) email: String,
    #[serde(rename = "e")]
    /// Timestamp in unix epoch after which the token is considered expired
    pub(super) expiration: i64,
}