From bc4bfa22705f46c3b14313011503346f16d18ebe Mon Sep 17 00:00:00 2001 From: Adam Chelminski Date: Fri, 15 Feb 2019 13:20:52 -0500 Subject: [PATCH] Small fixes for multi-user auth logic --- .../mongodb/stitch/core/auth/internal/CoreStitchAuth.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/core/sdk/src/main/java/com/mongodb/stitch/core/auth/internal/CoreStitchAuth.java b/core/sdk/src/main/java/com/mongodb/stitch/core/auth/internal/CoreStitchAuth.java index bb32297fd..6059dc083 100644 --- a/core/sdk/src/main/java/com/mongodb/stitch/core/auth/internal/CoreStitchAuth.java +++ b/core/sdk/src/main/java/com/mongodb/stitch/core/auth/internal/CoreStitchAuth.java @@ -355,10 +355,6 @@ public StitchUserT switchToUserWithId(final String userId) protected StitchUserT loginWithCredentialInternal(final StitchCredential credential) { authLock.writeLock().lock(); try { - if (!isLoggedIn()) { - return doLogin(credential, false); - } - if (credential.getProviderCapabilities().getReusesExistingSession()) { for (final AuthInfo authInfo : this.allUsersAuthInfo.values()) { if (authInfo.getLoggedInProviderType().equals(credential.getProviderType())) { @@ -753,7 +749,7 @@ private StitchUserT processLoginResponse( } catch (final IOException e) { // Back out of setting authInfo with this new user activeUserAuthInfo = oldActiveUserInfo; - activeUser = null; + activeUser = oldActiveUser; // this replaces auth info from the list of all users if // if the new auth info is not the same user as the older user