diff --git a/src/main/java/cactusServer/models/Accounts.java b/src/main/java/cactusServer/models/Accounts.java index 4b6b000..75f5a9f 100644 --- a/src/main/java/cactusServer/models/Accounts.java +++ b/src/main/java/cactusServer/models/Accounts.java @@ -27,13 +27,14 @@ } public Session createAcount(String userID, String userName, String userPass) { - if (!idSet.add(userID)) { + String uniqueID = RandomStringGenerator.createUniqueString(64, RandomStringGenerator.ALPHA_NUMERIC, idSet); + if (!idSet.add(uniqueID)) { return null; } Account newAccount = new Account(userID,userName, userPass); accounts.add(newAccount); newAccount.formToken(); - session = new Session(newAccount,URI.create(RandomStringGenerator.createUniqueString(64, RandomStringGenerator.ALPHA_NUMERIC, idSet))); + session = new Session(newAccount,URI.create(uniqueID)); return session; }