Skip to content

Commit

Permalink
FFM-10286 Fix last auth calc
Browse files Browse the repository at this point in the history
  • Loading branch information
erdirowlands committed Dec 28, 2023
1 parent f72b2d0 commit 9ce17fd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion force-app/main/classes/FFClient.cls
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,10 @@ public class FFClient {

Datetime lastAuthTime = Datetime.newInstance(lastAuthTimeMillis);

Integer expireAfterSeconds = this.client.config.authExpireAfter / 1000;

// Calculate the expiration time based on last authentication time and the expiration interval
Datetime expirationTime = lastAuthTime.addSeconds(this.client.config.authExpireAfter);
Datetime expirationTime = lastAuthTime.addSeconds(expireAfterSeconds);

// Subtract one hour (3600 seconds) from the expiration time to add a margin
Datetime marginTime = expirationTime.addSeconds(-3600);
Expand Down

0 comments on commit 9ce17fd

Please sign in to comment.