From 9a4751ef595f7939105fadaddf10a5aa95339e98 Mon Sep 17 00:00:00 2001 From: Andre Julius Date: Mon, 26 Jun 2023 17:17:25 +0200 Subject: [PATCH] Add getter for inner timestamp for NumericDate --- jwt-authorizer/src/claims.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/jwt-authorizer/src/claims.rs b/jwt-authorizer/src/claims.rs index c0f9fa7..9bca660 100644 --- a/jwt-authorizer/src/claims.rs +++ b/jwt-authorizer/src/claims.rs @@ -6,6 +6,13 @@ use serde::{de, Deserialize, Deserializer}; #[derive(Deserialize, Clone, PartialEq, Eq, Debug)] pub struct NumericDate(i64); +impl NumericDate { + /// Get the underlying unix timestamp + pub fn inner(&self) -> i64 { + self.0 + } +} + #[cfg(feature = "chrono")] use chrono::{DateTime, TimeZone, Utc};