Back

How to check a Token's time remaining until expire?

  • 0
  • Auth
  • Web
  • Cloud
Eilon
17 Oct, 2024, 09:22

When a Token is created, it's payload also contain "exp" property with the time it will expire.

I need to know if should I create a new token, so - how to check the token's time remaining? I cannot count on the server time I'm making the check at, right?

Is there some kind of server clock I can get access to? Thanks

TL;DR
Developers want to know how to check the remaining time until a token expires without relying on the server time. The "exp" property in the token's payload indicates the expiration time. There is no access to a server clock, but developers can determine the remaining time by comparing the expiration time from the token with the current time on the client-side.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more