bug fixed
This commit is contained in:
parent
135bc3b5e2
commit
62f76d5c1d
|
@ -10,12 +10,12 @@ name = "beteran_common_rust"
|
|||
path = "./src/lib.rs"
|
||||
|
||||
[dependencies]
|
||||
chrono = { version = "0" }
|
||||
jsonwebtoken = { version = "8" }
|
||||
lazy_static = { version = "1" }
|
||||
prost = { version = "0" }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = { version = "1" }
|
||||
time = { version = "0.3" }
|
||||
|
||||
beteran-protobuf-rust = { git = "https://gitlab.loafle.net/bet/beteran-protobuf-rust.git", tag = "v0.1.79-snapshot" }
|
||||
|
||||
|
|
|
@ -50,12 +50,13 @@ pub fn encode(issuer: &str, session_id: &str) -> Result<String, Error> {
|
|||
|
||||
let header = Header::new(Algorithm::RS256);
|
||||
|
||||
let issued_at = time::OffsetDateTime::now_utc();
|
||||
let expiration_at = issued_at + time::Duration::days(1);
|
||||
let issued_at = (chrono::Utc::now()).timestamp();
|
||||
let expiration_at = (chrono::Utc::now() + chrono::Duration::days(1)).timestamp();
|
||||
|
||||
let claims = Claims {
|
||||
iss: issuer.to_string(),
|
||||
iat: issued_at.unix_timestamp(),
|
||||
exp: expiration_at.unix_timestamp(),
|
||||
iat: issued_at,
|
||||
exp: expiration_at,
|
||||
session_id: session_id.to_string(),
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user