Reformat file

This commit is contained in:
Tobias Eidelpes 2021-05-20 11:33:01 +02:00
parent 8ed00c6ee5
commit fd89f5988e

View File

@ -39,7 +39,7 @@ public class GrpcServerRunner extends AuthServiceGrpc.AuthServiceImplBase implem
try { try {
String token = authenticationService.authenticate(request.getEmail(), request.getPassword()); String token = authenticationService.authenticate(request.getEmail(), request.getPassword());
response = AuthenticationResponse.newBuilder().setStatus("").setToken(token).build(); response = AuthenticationResponse.newBuilder().setStatus("").setToken(token).build();
} catch (NoSuchUserException e){ } catch (NoSuchUserException e) {
response = AuthenticationResponse.newBuilder().setStatus("NoSuchUserException").build(); response = AuthenticationResponse.newBuilder().setStatus("NoSuchUserException").build();
} catch (AuthenticationException e) { } catch (AuthenticationException e) {
response = AuthenticationResponse.newBuilder().setStatus("AuthenticationException").build(); response = AuthenticationResponse.newBuilder().setStatus("AuthenticationException").build();
@ -53,7 +53,7 @@ public class GrpcServerRunner extends AuthServiceGrpc.AuthServiceImplBase implem
public void validateToken(TokenValidationRequest request, StreamObserver<TokenValidationResponse> responseObserver) { public void validateToken(TokenValidationRequest request, StreamObserver<TokenValidationResponse> responseObserver) {
TokenValidationResponse response = TokenValidationResponse.newBuilder().setValid(false).build(); TokenValidationResponse response = TokenValidationResponse.newBuilder().setValid(false).build();
if(authenticationService.isValid(request.getToken())) if (authenticationService.isValid(request.getToken()))
response = TokenValidationResponse.newBuilder().setValid(true).build(); response = TokenValidationResponse.newBuilder().setValid(true).build();
responseObserver.onNext(response); responseObserver.onNext(response);