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?
@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.
You should also set :post-redirect?
to true and set the :location
in the context to the target URL.
Thanks, will try the above after installing the middleware you mentioned on #clojure