Skip to main content

mint

Function mint 

Source
pub fn mint(secret: &[u8], claims: &JwtClaims) -> String
Expand description

Mint a JWT-shaped session token. The output is the header.claims.sig triplet, ready to be returned in Authorization: Bearer … form. Client doesn’t need to know the difference from an opaque session token.

Panics in debug if claims.exp <= claims.iat — programmer error (the token would be instantly expired). Release builds let it through; the verifier would then reject as Expired.