我有這對我的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 –