I have an endpoint called /account which provides user info(returns html).
When unauthorised user tries to access this endpoint I need to be able to redirect to login page but in Liberator I found post-redirect so far and it is just for post methods.
I need to redirect get methods as well, how can I achieve this?
I found a workaround following code does the trick:
Or you can check
:authorized?and return login html from:handle-unauthorizedbut I doubt it about it's a good practice or not.