should allow edit for realz.
This commit is contained in:
@@ -13,7 +13,14 @@
|
|||||||
(context "/yodlee2" []
|
(context "/yodlee2" []
|
||||||
(GET "/fastlink" {:keys [query-params identity] :as request}
|
(GET "/fastlink" {:keys [query-params identity] :as request}
|
||||||
(assert-admin identity)
|
(assert-admin identity)
|
||||||
(let [token (yodlee/get-access-token (get query-params "client"))]
|
|
||||||
|
(let [token (if-let [client-id (get query-params "client-id")]
|
||||||
|
(-> client-id
|
||||||
|
Long/parseLong
|
||||||
|
d-clients/get-by-id
|
||||||
|
:client/code
|
||||||
|
(yodlee/get-access-token))
|
||||||
|
(yodlee/get-access-token (get query-params "client")))]
|
||||||
{:status 200
|
{:status 200
|
||||||
:headers {"Content-Type" "application/edn"}
|
:headers {"Content-Type" "application/edn"}
|
||||||
:body (pr-str {:token token
|
:body (pr-str {:token token
|
||||||
|
|||||||
@@ -9,13 +9,13 @@
|
|||||||
:component-did-mount (fn [this]
|
:component-did-mount (fn [this]
|
||||||
(let [{:keys [authentication provider-account-id]} (r/props this)]
|
(let [{:keys [authentication provider-account-id]} (r/props this)]
|
||||||
(try
|
(try
|
||||||
|
(println (js/parseInt provider-account-id) (:url authentication) (:token authentication))
|
||||||
(.open (.-fastlink js/window)
|
(.open (.-fastlink js/window)
|
||||||
#js {"fastLinkURL" (:url authentication)
|
#js {"fastLinkURL" (:url authentication)
|
||||||
"accessToken" (:token authentication)
|
"accessToken" (:token authentication)
|
||||||
"params" #js { "configName" "Aggregation"
|
"params" #js {"configName" "Aggregation"
|
||||||
"providerAccountId" (js/parseInt provider-account-id)
|
"providerAccountId" (js/parseInt provider-account-id)
|
||||||
"flow" "edit"}}
|
"flow" "edit"}}
|
||||||
|
|
||||||
"fa-modal-spot")
|
"fa-modal-spot")
|
||||||
(catch js/Error e
|
(catch js/Error e
|
||||||
(println e)))))
|
(println e)))))
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
(re-frame/reg-event-fx
|
(re-frame/reg-event-fx
|
||||||
::reauthenticate-start
|
::reauthenticate-start
|
||||||
(fn [_ [_ _ provider-account-id authentication]]
|
(fn [_ [_ provider-account-id authentication]]
|
||||||
{:dispatch [::modal/modal-requested {:title (str "Reauthenticate " provider-account-id)
|
{:dispatch [::modal/modal-requested {:title (str "Reauthenticate " provider-account-id)
|
||||||
:body [form {:provider-account-id provider-account-id
|
:body [form {:provider-account-id provider-account-id
|
||||||
:authentication authentication}]
|
:authentication authentication}]
|
||||||
|
|||||||
@@ -44,10 +44,10 @@
|
|||||||
{:http {:token user
|
{:http {:token user
|
||||||
:method :get
|
:method :get
|
||||||
:headers {"Content-Type" "application/edn"}
|
:headers {"Content-Type" "application/edn"}
|
||||||
:uri (str "/api/yodlee2/fastlink?client=" client-id)
|
:uri (str "/api/yodlee2/fastlink?client-id=" client-id)
|
||||||
:owns-state {:multi ::request-login-form
|
:owns-state {:multi ::request-login-form
|
||||||
:which (:id provider-account)}
|
:which (:id provider-account)}
|
||||||
:on-success [::form/reauthenticate-start client-id provider-account]}}))
|
:on-success [::form/reauthenticate-start provider-account]}}))
|
||||||
|
|
||||||
(re-frame/reg-event-fx
|
(re-frame/reg-event-fx
|
||||||
::delete-provider-account
|
::delete-provider-account
|
||||||
|
|||||||
Reference in New Issue
Block a user