diff --git a/src/lib.rs b/src/lib.rs index 41b10f9..c5c23b7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -24,4 +24,4 @@ pub use decoding::{ }; pub use encoding::{encode, EncodingKey}; pub use header::Header; -pub use validation::Validation; +pub use validation::{get_current_timestamp, Validation}; diff --git a/src/validation.rs b/src/validation.rs index 4cf7726..b8e5a83 100644 --- a/src/validation.rs +++ b/src/validation.rs @@ -97,7 +97,8 @@ impl Default for Validation { } } -fn get_current_timestamp() -> u64 { +/// Gets the current timestamp in the format JWT expect +pub fn get_current_timestamp() -> u64 { let start = SystemTime::now(); start.duration_since(UNIX_EPOCH).expect("Time went backwards").as_secs() }