pub struct VerificationToken {
pub id: String,
pub kind: TokenKind,
pub email: String,
pub user_id: Option<String>,
pub payload: Option<String>,
pub token_hash: String,
pub token_prefix: String,
pub created_at: u64,
pub expires_at: u64,
pub consumed_at: Option<u64>,
}Fields§
§id: StringStable id for management UIs / audit logs (vt_<24-base64url>).
kind: TokenKind§email: StringEmail this token was minted for. Lowercased before storage.
user_id: Option<String>User id when known at mint time (email-change flow). None for password-reset / magic-link minted before any auth.
payload: Option<String>Arbitrary opaque payload (e.g. email-change carries the proposed new email here so consume() can apply it without a second round-trip).
token_hash: StringHMAC-SHA256 of the plaintext + server pepper (hex). Constant- time-compared at consume time.
token_prefix: StringFirst 8 chars of the plaintext for index narrowing — same trick as the org invite path.
created_at: u64§expires_at: u64§consumed_at: Option<u64>Stamped on first successful consume so a replay returns the
AlreadyConsumed error rather than NotFound.
Trait Implementations§
Source§impl Clone for VerificationToken
impl Clone for VerificationToken
Source§fn clone(&self) -> VerificationToken
fn clone(&self) -> VerificationToken
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VerificationToken
impl Debug for VerificationToken
Source§impl<'de> Deserialize<'de> for VerificationToken
impl<'de> Deserialize<'de> for VerificationToken
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for VerificationToken
impl PartialEq for VerificationToken
Source§impl Serialize for VerificationToken
impl Serialize for VerificationToken
impl Eq for VerificationToken
impl StructuralPartialEq for VerificationToken
Auto Trait Implementations§
impl Freeze for VerificationToken
impl RefUnwindSafe for VerificationToken
impl Send for VerificationToken
impl Sync for VerificationToken
impl Unpin for VerificationToken
impl UnsafeUnpin for VerificationToken
impl UnwindSafe for VerificationToken
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more