should allow edit for realz.
This commit is contained in:
@@ -13,7 +13,14 @@
|
||||
(context "/yodlee2" []
|
||||
(GET "/fastlink" {:keys [query-params identity] :as request}
|
||||
(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
|
||||
:headers {"Content-Type" "application/edn"}
|
||||
:body (pr-str {:token token
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
:component-did-mount (fn [this]
|
||||
(let [{:keys [authentication provider-account-id]} (r/props this)]
|
||||
(try
|
||||
(println (js/parseInt provider-account-id) (:url authentication) (:token authentication))
|
||||
(.open (.-fastlink js/window)
|
||||
#js {"fastLinkURL" (:url authentication)
|
||||
"accessToken" (:token authentication)
|
||||
"params" #js { "configName" "Aggregation"
|
||||
"params" #js {"configName" "Aggregation"
|
||||
"providerAccountId" (js/parseInt provider-account-id)
|
||||
"flow" "edit"}}
|
||||
|
||||
"fa-modal-spot")
|
||||
(catch js/Error e
|
||||
(println e)))))
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
(re-frame/reg-event-fx
|
||||
::reauthenticate-start
|
||||
(fn [_ [_ _ provider-account-id authentication]]
|
||||
(fn [_ [_ provider-account-id authentication]]
|
||||
{:dispatch [::modal/modal-requested {:title (str "Reauthenticate " provider-account-id)
|
||||
:body [form {:provider-account-id provider-account-id
|
||||
:authentication authentication}]
|
||||
|
||||
@@ -44,10 +44,10 @@
|
||||
{:http {:token user
|
||||
:method :get
|
||||
: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
|
||||
: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
|
||||
::delete-provider-account
|
||||
|
||||
Reference in New Issue
Block a user