small medium large xlarge

Back to: All Forums  Grails
Xbl avatar 2_pragsmall
09 Aug 2009, 19:30
Brian T. Grant (2 posts)


I finally finished reading chapter 10 the other night and noticed in the screen shot on pg 174 that you’re viewing the index page w/out being logged in. I can’t manage to make that happen. With the @doLogin@ filter set up the way it is (also on 174), since @session.user@ can’t be @null@, should you be able to get to the index page? I added some debugging @println@ to @doLogin@ and both @actionName@ and @controllerName@ are @null@ when viewing the index page, regardless of whether a user is logged in.

Should I be able to get to the index page w/out being logged in by that point (i.e. have I missed something)?

Thanks again for the great book! - Brian

10 Aug 2009, 00:08
Dave Klein (34 posts)

Hi Brian,

That should be fixed in the latest beta release but here’s the fix. In the SecurityFilter at the beginning of the before closure, check for a controllerName. If there isn’t one then we are heading for the index page so we’ll just return true and go on our merry way. Something like this:

    before = {
        *if (!controllerName)*
          *return true*
Xbl avatar 2_pragsmall
10 Aug 2009, 17:04
Brian T. Grant (2 posts)


That makes sense. Thanks!

  • Brian
You must be logged in to comment