Implement Authentication Filter (2.1.3.3)
This commit is contained in:
@@ -11,6 +11,7 @@ import io.grpc.ServerBuilder;
|
||||
import io.grpc.stub.StreamObserver;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import javax.inject.Singleton;
|
||||
import java.io.IOException;
|
||||
@@ -20,7 +21,7 @@ import java.io.IOException;
|
||||
public class GrpcServerRunner extends AuthServiceGrpc.AuthServiceImplBase implements IGrpcServerRunner {
|
||||
@Resource
|
||||
private GrpcServerProperties properties;
|
||||
@Resource
|
||||
@Inject
|
||||
private IAuthenticationService authenticationService;
|
||||
|
||||
@Override
|
||||
@@ -37,7 +38,7 @@ public class GrpcServerRunner extends AuthServiceGrpc.AuthServiceImplBase implem
|
||||
AuthenticationResponse response;
|
||||
try {
|
||||
String token = authenticationService.authenticate(request.getEmail(), request.getPassword());
|
||||
response = AuthenticationResponse.newBuilder().setToken(token).build();
|
||||
response = AuthenticationResponse.newBuilder().setStatus("").setToken(token).build();
|
||||
} catch (NoSuchUserException e){
|
||||
response = AuthenticationResponse.newBuilder().setStatus("NoSuchUserException").build();
|
||||
} catch (AuthenticationException e) {
|
||||
|
||||
Reference in New Issue
Block a user