emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/url-http-oauth 9b2af487e3 22/24: Use relative expiry ti


From: Thomas Fitzsimmons
Subject: [elpa] externals/url-http-oauth 9b2af487e3 22/24: Use relative expiry time in seconds
Date: Mon, 8 May 2023 21:10:48 -0400 (EDT)

branch: externals/url-http-oauth
commit 9b2af487e3cb3e8ae8f5a17f4de33586cabcc37b
Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Commit: Thomas Fitzsimmons <fitzsim@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

[Prev in Thread] Current Thread [Next in Thread]