Playframework with CSRF : “CSRF token not found in session”?

后端 未结 2 629
遥遥无期
遥遥无期 2021-02-15 19:01

I\'m making a simple authentication system using Playframework with their built-in CSRF filter and Security.Authenticator system, but I\'m facing a problem :

When the us

2条回答
  •  旧巷少年郎
    2021-02-15 19:13

    Add the below line in Global.java

    @Override
    public  Class[] filters() {
        return new Class[]{CSRFFilter.class};
    }
    

    For this you have to import

    import play.api.mvc.EssentialFilter;
    import play.filters.csrf.CSRFFilter;
    

    Hope this will help you

提交回复
热议问题