21 lines
728 B
Rust
21 lines
728 B
Rust
|
use serde::{Deserialize, Serialize};
|
||
|
use time::OffsetDateTime;
|
||
|
|
||
|
// #[derive(Debug, Serialize, Deserialize)]
|
||
|
// struct Claims {
|
||
|
// aud: String, // Optional. Audience
|
||
|
// exp: usize, // Required (validate_exp defaults to true in validation). Expiration time (as UTC timestamp)
|
||
|
// iat: usize, // Optional. Issued at (as UTC timestamp)
|
||
|
// iss: String, // Optional. Issuer
|
||
|
// nbf: usize, // Optional. Not Before (as UTC timestamp)
|
||
|
// sub: String, // Optional. Subject (whom token refers to)
|
||
|
// }
|
||
|
|
||
|
#[derive(Debug, Serialize, Deserialize)]
|
||
|
pub struct Claims {
|
||
|
pub iss: String,
|
||
|
pub iat: OffsetDateTime,
|
||
|
pub exp: OffsetDateTime,
|
||
|
pub session_id: String,
|
||
|
}
|