liberator

adam 2020-06-07T03:07:39.004900Z

Hi all. I am wondering if Liberator handles HTML login forms or it's just for APIs. I am particularly confused about what to do after using post! , what if: 1. The provided credentials are correct, how can I redirect the user to, say, my dashboard? 2. The provided credentials are invalid, how can show my :handle-ok contents back with some error message?

ordnungswidrig 2020-06-07T20:31:13.006Z

@somedude314 if the credentials are incorrect (which you would check in :authorized? ) then :handle-not-authorized kicks in (returning status 401). There you can also return your message.

ordnungswidrig 2020-06-07T20:33:13.007Z

You should also set :post-redirect? to true and set the :location in the context to the target URL.

adam 2020-06-07T20:39:16.007800Z

Thanks, will try the above after installing the middleware you mentioned on #clojure