use of org.platformlayer.auth.model.RegistrationResponse in project platformlayer by platformlayer.
the class RegisterResource method register.
private RegistrationResponse register(RegistrationRequest request) {
RegistrationResponse response = new RegistrationResponse();
String username = request.username;
String password = request.password;
UserEntity userEntity;
try {
OpsUser user = registrationService.registerUser(username, password);
userEntity = (UserEntity) user;
} catch (CustomerFacingException e) {
response.errorMessage = e.getMessage();
return response;
}
if (userEntity == null) {
log.warn("Authentication request failed immediately after registration. Username=" + username);
throw new IllegalStateException();
}
response.access = tokenHelpers.buildAccess(userEntity);
return response;
}
Aggregations