I'm using deadbolt library for authentication in my playframewrok server app which holds api for some other frontend application. In MyDeadboltHandler class in onAuthFailure method when user isn't authenticated I want to return status 403 with next piece of code:
@Override
public F.Promise<Result> onAuthFailure(Http.Context context, String content) {
return F.Promise.pure(unauthorized("Authentication Failed"));
}
however in my frontend application (Angular 1.5) in my error handler Im getting response which is some generic error with error status code -1 How can I change my method this to get normal 403 error status in response?