...
 
Commits (2)
......@@ -21,6 +21,7 @@ import ch.insign.playauth.authz.AuthorizationHandler;
import com.google.common.base.Throwables;
import org.apache.shiro.authz.AuthorizationException;
import org.apache.shiro.authz.UnauthenticatedException;
import org.apache.shiro.authz.UnauthorizedException;
import play.mvc.Action;
import play.mvc.Http.Context;
import play.mvc.Result;
......@@ -57,7 +58,7 @@ public class WithSubjectAction<T> extends Action<T> {
return getAuthorizationHandler().onUnauthenticated(ctx, (AuthorizationException) rootCause);
}
if (rootCause instanceof UnauthenticatedException) {
if (rootCause instanceof UnauthorizedException) {
return getAuthorizationHandler().onUnauthorized(ctx, (AuthorizationException) rootCause);
}
......
......@@ -20,13 +20,18 @@ import ch.insign.playauth.party.PartyRepository;
import ch.insign.playauth.party.PartyService;
import ch.insign.playauth.party.support.DefaultPartyRepository;
import ch.insign.playauth.party.support.DefaultPartyService;
import com.google.inject.AbstractModule;
import play.api.Configuration;
import play.api.Environment;
import play.api.inject.Binding;
import play.api.inject.Module;
import scala.collection.Seq;
public class PartyServiceModule extends AbstractModule {
public class PartyServiceModule extends Module {
@Override
protected void configure() {
bind(PartyRepository.class).to(DefaultPartyRepository.class);
bind(PartyService.class).to(DefaultPartyService.class);
public Seq<Binding<?>> bindings(Environment environment, Configuration configuration) {
return seq(
bind(PartyRepository.class).to(DefaultPartyRepository.class),
bind(PartyService.class).to(DefaultPartyService.class));
}
}