diff --git a/src/main/java/cactusServer/models/Accounts.java b/src/main/java/cactusServer/models/Accounts.java index ca25106..fcee254 100644 --- a/src/main/java/cactusServer/models/Accounts.java +++ b/src/main/java/cactusServer/models/Accounts.java @@ -14,8 +14,7 @@ private ArrayList accounts = new ArrayList<>(ACCOUNT_NUM_MAX); private HashSet userIDSet = new HashSet<>(ACCOUNT_NUM_MAX); private HashSet uniqueIDSet = new HashSet<>(ACCOUNT_NUM_MAX); - private URIAddressedEntity session; - + private Accounts() { } @@ -35,9 +34,7 @@ uniqueIDSet.add(uniqueID); Account newAccount = new Account(userID, userName, userPass, uniqueID); accounts.add(newAccount); - session = new URIAddressedEntity("/CactusServer/rest/accounts/" + uniqueID, newAccount); - - return session; + return new URIAddressedEntity("/CactusServer/rest/accounts/" + uniqueID, newAccount); } public Account getAccountToken(String token) { @@ -88,10 +85,9 @@ if (getAccountByID(userID) != null && getAccountByID(userID).getPass().equals(userPass)) { Accounts.getInstance().getAccountByID(userID).setLogin(true); Accounts.getInstance().getAccountByID(userID).formToken(); - session = new URIAddressedEntity( + return new URIAddressedEntity( "/CactusServer/rest/accounts/" + Accounts.getInstance().getAccountByID(userID).getUniqueID(), Accounts.getInstance().getAccountByID(userID)); - return session; } else { return null; }