java - Trying to use simple authentication in Play Framework, but my action is called twice -
i used samples add simple authentication app. annotation of:
@security.authenticated(shlangauthenticator.class) public static result processshlangcommand()
and class shlangauthenticator based on sample:
public class shlangauthenticator extends security.authenticator { @override public string getusername(context ctx) { string s = ctx.session().get("email"); system.err.println("getusernamecalled: " + s); return s; } @override public result onunauthorized(context ctx) { system.err.println("onunauthorized called"); return redirect("http://localhost/#/login"); }
}
the problem getting every call action (processshlangcommand() ) being called twice play (play 2.1.1), printed stack trace , seems identical. on appreciated.
perhaps it's because you're using system.err log, instead of default logger in play? regardless, authentication, i'm using module: https://github.com/joscha/play-authenticate
Comments
Post a Comment