无法覆盖LoginController的authFail()

时间:2018-10-11 06:54:19

标签: grails spring-security login

我需要自定义消息,所以我试图通过简单地覆盖grails .plugin.springsecurity.LoginController来修改LoginController

我从我的customizedAuthenticationProvider中抛出了AccountNotApprovedException。

有人可以建议我我所缺少的吗?

class AccountNotApprovedException extends AuthenticationException{

    public AccountNotApprovedException(String message, Throwable t) {
        super(message, t)
    }

    public AccountNotApprovedException(String message) {
        super(message)
    }

    /** @deprecated */
    @Deprecated
    public AccountNotApprovedException(String message, Object extraInformation) {
        super(message, extraInformation)
    }
}

我覆盖了loginController:-

class LoginController extends grails.plugin.springsecurity.LoginController {


    def authenticationTrustResolver

    /**
     * Dependency injection for the springSecurityService.
     */
    def springSecurityService


    def authfail() {

        //my customized code
    }



}

当springSecurity运行时,它没有调用覆盖的authFail()

0 个答案:

没有答案