use of com.janfic.games.computercombat.model.Profile in project computercombat by janfic.
the class AWSServices method createUser.
public String createUser(String username, String email, String password) throws UsernameExistsException {
AttributeType emailAttribute = AttributeType.builder().name("email").value(email).build();
SignUpRequest request = SignUpRequest.builder().username(username).userAttributes(emailAttribute).password(password).clientId("7ivqqa7m71v3ob6qnof7djh90t").build();
SignUpResponse response = cognito.signUp(request);
String userSub = response.userSub();
Profile p = new Profile(userSub);
p.setEmail(email);
p.setName(username);
SQLAPI.getSingleton().saveProfile(p);
FileHandle f = Gdx.files.internal("starterCollection.csv");
Scanner scanner = new Scanner(f.readString());
while (scanner.hasNextLine()) {
int cardID = Integer.parseInt(scanner.nextLine());
System.out.println(cardID);
System.out.println(p.getUID());
SQLAPI.getSingleton().addCardToProfile(cardID, p);
}
return userSub;
}
Aggregations