I am using Acegi with grails, but I have a redirect problem.
I define in UrlMapping this:
"/" {
controller = "mycontroller"
action = "myaction"
}
In mycontroller:
myaction = {
if (authenticateService.isLoggedIn(){ "/mycontext/public" }
else {
if (role = ROLE_1) {
redirect "/mycontext/myactionforNormalUser"
}
else if (role = ROLE_ADMIN) {
redirect "/mycontext/myactionforROLEADMIN"
}
}
}
If I go to my application without logging in, I’m redirected to a public page, so that’s correct. But when I log in to the admin, I am redirected to auth / deniedAjax (from acegi), and not to my page. And if I log in as a regular user, I redirect to the ajax define method in my gsp.
Do you have an idea?
Many thanks.
source
share