Grails spring security defaultTargetUrl going wrong path

Posted by fsi on Stack Overflow See other posts from Stack Overflow or by fsi
Published on 2014-06-09T01:34:16Z Indexed on 2014/06/13 3:25 UTC
Read the original article Hit count: 179

Filed under:
|

Grails 2.4 with Spring security 2 3RC

I have this on my Config.groovy

grails.plugin.springsecurity.controllerAnnotations.staticRules = [
    '/':                              ['permitAll'],
    '/index':                         ['permitAll'],
    '/index.gsp':                     ['permitAll'],
    '/**/js/**':                      ['permitAll'],
    '/**/css/**':                     ['permitAll'],
    '/**/images/**':                  ['permitAll'],
    '/**/favicon.ico':                ['permitAll']
]
grails.plugin.springsecurity.successHandler.defaultTargetUrl = "/home/index"

But this keeping me redirecting to

assets/favicon.ico

And my HomeController is like that

@Secured(['ROLE_ADMIN', 'ROLE_USER'])
def index() {
    if (SpringSecurityUtils.ifAllGranted('ROLE_ADMIN')) {
        redirect controller: 'admin', action: 'index'
        return
    }
}

And I modify this in my UrlMapping:

"/"(controller: 'home', action:'index')

Why it keeps me sending wrong path?

Update: using another computer, it redirects me to /asset/grails_logo.png

© Stack Overflow or respective owner

Related posts about spring

Related posts about grails