mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-04 15:41:37 -05:00
jupyter-api-request: Ask for authorization on next request after an un-authorized one
What is a better solution?
This commit is contained in:
parent
194df39643
commit
9241296b45
1 changed files with 8 additions and 1 deletions
|
@ -510,7 +510,14 @@ opened using the REST api url and PLIST will be used in a call to
|
|||
(append
|
||||
(plist-get head :custom-header-alist)
|
||||
url-request-extra-headers))))
|
||||
(apply #'jupyter-api--request method plist)))
|
||||
(condition-case err
|
||||
(apply #'jupyter-api--request method plist)
|
||||
(jupyter-api-http-error
|
||||
;; Reset the `auth' state when un-authorized so that we ask again.
|
||||
(when (and (= (cadr err) 403)
|
||||
(equal (caddr err) "Forbidden"))
|
||||
(oset client auth 'ask))
|
||||
(signal (car err) (cdr err))))))
|
||||
|
||||
;;; Endpoints
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue