diff --git a/src/nodash/core/NoRegister.java b/src/nodash/core/NoRegister.java index ef40d34..500f4f0 100644 --- a/src/nodash/core/NoRegister.java +++ b/src/nodash/core/NoRegister.java @@ -20,4 +20,9 @@ package nodash.core; public final class NoRegister { public byte[] cookie; public byte[] data; + + public NoRegister(byte[] cookie, byte[] data) { + this.cookie = cookie; + this.data = data; + } } diff --git a/src/nodash/core/spheres/NoSessionSphere.java b/src/nodash/core/spheres/NoSessionSphere.java index 25ef007..5f5615c 100644 --- a/src/nodash/core/spheres/NoSessionSphere.java +++ b/src/nodash/core/spheres/NoSessionSphere.java @@ -176,12 +176,11 @@ public final class NoSessionSphere { } public static synchronized NoRegister registerUser(NoUser user, char[] password) { - NoRegister result = new NoRegister(); NoSession session = new NoSession(user); NoSessionSphere.sessions.put(session.uuid, session); - result.cookie = session.getEncryptedUUID(); try { - result.data = NoSessionSphere.save(result.cookie, password); + byte[] cookie = session.getEncryptedUUID(); + return new NoRegister(cookie, NoSessionSphere.save(cookie, password)); } catch (NoDashSessionBadUUIDException e) { throw new NoDashFatalException("Immediately generated cookie throwing bad cookie error.", e); } catch (NoSessionExpiredException e) { @@ -196,6 +195,5 @@ public final class NoSessionSphere { throw new NoDashFatalException( "Session claims to be awaiting confirmation before returning data to the user.", e); } - return result; } }