branch: externals/url-http-oauth
commit 9b2af487e3cb3e8ae8f5a17f4de33586cabcc37b
Author: Thomas Fitzsimmons <fitz...@fitzsim.org>
Commit: Thomas Fitzsimmons <fitz...@fitzsim.org>

    Use relative expiry time in seconds
    
    * url-http-oauth.el (url-http-oauth--expiry-string): Use
    expires_in, not expires_on.
---
 url-http-oauth.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/url-http-oauth.el b/url-http-oauth.el
index 30e0007ce3..4ca678314e 100644
--- a/url-http-oauth.el
+++ b/url-http-oauth.el
@@ -287,9 +287,9 @@ endpoint."
 (defun url-http-oauth--expiry-string (grant)
   "Return as a string a number representing the expiry time of GRANT.
 The time is in seconds since the epoch."
-  (let ((expiry (gethash "expires_on" grant)))
+  (let ((expiry (gethash "expires_in" grant)))
     (unless expiry (error "url-http-oauth: Did not find expiry time in grant"))
-    expiry))
+    (format-time-string "%s" (time-add nil (string-to-number expiry)))))
 
 (defun url-http-oauth--refresh-token-string (grant)
   "Return the refresh token from GRANT.

Reply via email to