in my Grails app I have a couple of simple security filters (please note it's just a prototype, not a commercial app:
securityCheckFilter(controller:'overview', invert:true) {
before = {
if(!session?.gaSession?.gaUser) {
flash.message = "You are not authorised to see this page. Please login."
redirect(controller:'overview',action:'login')
return false
}
return true
}
}
Which means that, apart from the controller 'overview' that handles the login/registration, all the other controllers require authentication. The problem is that I'd like to implement this typical flow:
(1) user tries protected url (2) redirection to login (3) successful login (4) redirection to url
In my code it works until point 3, but I'm missing 4.
Any hints?
To redirect the user after they log out from a specific application, you must add the URL used in the returnTo parameter of the redirect URL to the Allowed Logout URLs list in the Settings tab of your Auth0 application that is associated with the CLIENT_ID parameter.
WP Login and Logout RedirectUpon installation, you'll find the new Redirect Options menu in your sidebar. Click it, and you'll see two boxes: Login Redirect URL and Logout Redirect URL. Put the URL you want in and click Save Changes, and you're done. Redirect options in the WP Login and Logout Redirect plugin.
To redirect from an HTML page, we use the META Tag. Along with this, we also use the http-equiv attribute to provide an HTTP header for the value of the content attribute. The value in the content is the number of seconds; you want the page to redirect after.
It's actually quite easy. Just
To get the target URI (in your filter), just remove the context path from the forward URI:
def targetURI = request.forwardURI - request.contextPath
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With