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?
I just stumbled in the same scenario, and as nico_ekito pointed out, this can be achieved by extending
PlayAuthenticate.Resolver
and overriding:So you can return any route of your app.
I ended up handling this at the controller:
There might be better ways to do this though.