playframework 2.0 - Deadbolt - Access failure redirect is not working -
i using deadbolt 2 playframework 2.1
i have public page user clicks on action button , controller method called, method has @subjectpresent on it. want redirect user login page if user not logged in , after user logs in execute method call.
i call controller method through jsroutes below
function launchdemo(demoid){ jsroutes.controllers.demolaunchapplication.launchdemo(demoid).ajax({ success: function(data, textstatus) { $("#result").html(data); }, error: function(data) { alert("error"); $("#result").html(data); } }) }
i have setup deadbolt 2 based on project sample here.(https://github.com/joscha/play-authenticate/tree/master/samples/java/play-authenticate-usage)
i following errors in console.
[error] application - access [/test/launch?testid=2] requires subject, no subject present. [warn] application - deadbolt: access failure on [/test/launch?testid=2]
and in result div, login page being shown. want redirect login page instead , after login run method call.
i did try add statuscode , ajaxerror, response header status 200 , each time success block executed showed login form in result div.
it looks need change onauthfailure of deadbolthandler implementation. if have copied 1 example code, it's returning 403. instead, should return redirect login page.
Comments
Post a Comment