I have a filter that i want to filter every action except ONE that brings me to login page.
If i filter all pages with some condition then even the LOGIN page too get filtered and so it stuck in infinte loop as condition not fulfilled (User not Logged IN).
session.getAttribute("CurrentEmployeeIds") it tell whether user is logged in or not
My filter here:
class LoginFilters {
def filters = {
all(controller:'dashboard', action:'*') {
before = {
if (session.getAttribute("CurrentEmployeeIds")==null) {
redirect(controller:"site",action:"index")
return false
}
}
after = { Map model ->
}
afterView = { Exception e ->
}
}
}
}
I want to filter in such a way that it don't filter controller:"site",action:"index"
this url and filter everything else.
thanks in advance.