routes are now secured.
This commit is contained in:
@@ -14,13 +14,16 @@
|
||||
|
||||
(re-frame/reg-fx
|
||||
:http
|
||||
(fn [{:keys [method uri on-success body headers]}]
|
||||
(fn [{:keys [method uri on-success body headers token]}]
|
||||
(go
|
||||
(->> (http/request {:method method
|
||||
:body body
|
||||
:headers headers
|
||||
:url uri})
|
||||
(<! )
|
||||
:body
|
||||
(conj on-success)
|
||||
(re-frame/dispatch)))))
|
||||
(let [headers (if token
|
||||
(assoc headers "Authorization" (str "Token " token))
|
||||
headers)]
|
||||
(->> (http/request {:method method
|
||||
:body body
|
||||
:headers headers
|
||||
:url uri})
|
||||
(<! )
|
||||
:body
|
||||
(conj on-success)
|
||||
(re-frame/dispatch))))))
|
||||
|
||||
Reference in New Issue
Block a user