@@ -61,7 +61,7 @@ pub fn generate_jwt(
6161 app_id: ref String,
6262 private_key_pem: ref String,
6363) -{IO}-> Result<String, String> {
64- let now_seconds = Time::now_millis() /. 1000.0;
64+ let now_seconds = Time::now_millis() / 1000.0;
6565
6666 let header = json::encode_object([
6767 ("alg", json::encode_string("RS256")),
@@ -71,8 +71,8 @@ pub fn generate_jwt(
7171
7272 let payload = json::encode_object([
7373 ("iss", json::encode_string(app_id)),
74- ("iat", json::encode_float(now_seconds -. 60.0)),
75- ("exp", json::encode_float(now_seconds +. 600.0)),
74+ ("iat", json::encode_float(now_seconds - 60.0)),
75+ ("exp", json::encode_float(now_seconds + 600.0)),
7676 ]);
7777 let payload_b64 = base64_url_encode_string(json::stringify(payload));
7878
@@ -111,7 +111,7 @@ pub fn get_installation_token(
111111
112112 match cache_get(cache_key) {
113113 Some(cached) => {
114- if cached.expiresAt > Time::now_millis() +. 60000.0 {
114+ if cached.expiresAt > Time::now_millis() + 60000.0 {
115115 Ok(cached)
116116 } else {
117117 fetch_installation_token(jwt, cache_key)
0 commit comments