9b2af487e3cb3e8ae8f5a17f4de33586cabcc37b — Thomas Fitzsimmons 11 months ago 7e825a8
Use relative expiry time in seconds

* url-http-oauth.el (url-http-oauth--expiry-string): Use
expires_in, not expires_on.
1 files changed, 2 insertions(+), 2 deletions(-)

M url-http-oauth.el
M url-http-oauth.el => url-http-oauth.el +2 -2
@@ 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"))
    (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.