play-authenticate

Play-Authenticate logout redirect

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-13 06:17:06
问题 I have integrated the Play-Authenticate module in my Play 2.0.4 project. There are two views to my project, a conventional web view and a mobile view. When the application logs out it just returns to the index page. In the routes table I see that the logout functionality points towards this: GET /logout com.feth.play.module.pa.controllers.Authenticate.logout Which looks like this in the module code: public static Result logout() { noCache(response()); return PlayAuthenticate.logout(session())

Play 2 Java authenticate plugin - HTTP status code response instead of redirect

左心房为你撑大大i 提交于 2020-01-05 04:03:32
问题 We are using Play 2 authenticate plugin for a REST API and I would like to simply return 200 or 403 for login attempts. The plugin's code looks like this: public static Result loginAndRedirect(final Context context, final AuthUser loginUser) { storeUser(context.session(), loginUser); return Controller.redirect(getJumpUrl(context)); } Is there any way to avoid the redirect without forking the plugin project? 回答1: I ended up handling this at the controller: public static Result login() { Result