Fork me on GitHub
#ring
<
2020-04-17
>
jtth22:04:02

how am i supposed to be, say, redirecting back to a url after a login attempt? I keep getting csrf errors with this (luminus)

(defn login! [{:keys [session params]}]
  "logs user in"
  (if-let [user-identity (authenticate
                           (get-in params [:email])
                           (get-in params [:pass]))]
    (-> (response/found "/authenticated-test") ;; fixme: this just... doesn't work
        (response/ok)
        (assoc :session (assoc session :identity user-identity)))
    (response/unauthorized {:result  :unauthorized
                            :message "login failure"})))

seancorfield22:04:20

@jtth Looks like you're overriding the redirect response/found with response/ok there?

jtth15:04:53

that was it! thank you very much!