我有这对我的application.yml
:春季安全 - Grails的3.2.2 - ERR_TOO_MANY_REDIRECTS
grails.plugin.springsecurity.successHandler.alwaysUseDefault = true
grails.plugin.springsecurity.successHandler.defaultTargetUrl = '/l/loggedIn'
而且l/loggedIn
的样子:
def loggedIn() {
User user = springSecurityService.currentUser
def roleDefault = Role.findByAuthority("ROLE_DEFAULT")
if(user.authorities.contains(roleDefault))
redirect(controller: 'foo', action:'index')
def roleAdmin = Role.findByAuthority("ROLE_ADMIN")
if(user.authorities.contains(roleAdmin))
redirect(view: 'index')
}
当我登录在我的应用程序得到admin
ERR_TOO_MANY_REDIRECTS
错误。
任何方式解决这一问题?
更新
@Secured(["ROLE_ADMIN", "ROLE_DEFAULT"])
class FooController {
def index() {}
}
它只发生在管理员用户@AdeelAnsari –