fix(login): auth-callback&auth-refresh-token return json type resp

This commit is contained in:
rcmerci
2022-05-10 14:38:25 +08:00
committed by Andelf
parent 504b47b67a
commit adc80088e8

View File

@@ -85,10 +85,8 @@
{:with-credentials? false}))]
(if (= 200 (:status resp))
(-> resp
(:body)
(js/JSON.parse)
(js->clj :keywordize-keys true)
(as-> $ (set-tokens! (:id_token $) (:access_token $) (:refresh_token $))))
:body
(as-> $ (set-tokens! (:id_token $) (:access_token $) (:refresh_token $))))
(debug/pprint "login-callback" resp)))))
(defn logout []
@@ -111,9 +109,7 @@
(->
resp
(as-> $ (and (http/unexceptional-status? (:status $)) $))
(:body)
(js/JSON.parse)
(js->clj :keywordize-keys true)
:body
(as-> $ (set-tokens! (:id_token $) (:access_token $))))
true))))))