浏览代码

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

rcmerci 3 年之前
父节点
当前提交
adc80088e8
共有 1 个文件被更改,包括 3 次插入7 次删除
  1. 3 7
      src/main/frontend/handler/user.cljs

+ 3 - 7
src/main/frontend/handler/user.cljs

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