Skip to content

Commit

Permalink
Check the login mode before exiting when already logged in (#21695)
Browse files Browse the repository at this point in the history
  • Loading branch information
nbradbury authored Feb 21, 2025
1 parent 90d5e86 commit ae20186
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,11 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
// when displaying that screen
mLoginHelper.bindCustomTabsService(this);

if (mLoginHelper.isLoggedIn()) {
// go no further if the user is already logged in and this is the login screen shown at startup
// FULL = WPAndroid
// JETPACK_LOGIN_ONLY = JPAndroid
LoginMode loginMode = getLoginMode();
if ((mLoginHelper.isLoggedIn()) && (loginMode == LoginMode.FULL || loginMode == LoginMode.JETPACK_LOGIN_ONLY)) {
this.loggedInAndFinish(new ArrayList<Integer>(), true);
return;
}
Expand All @@ -173,7 +177,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {

mLoginAnalyticsListener.trackLoginAccessed();

switch (getLoginMode()) {
switch (loginMode) {
case FULL:
case JETPACK_LOGIN_ONLY:
mUnifiedLoginTracker.setSource(Source.DEFAULT);
Expand Down

0 comments on commit ae20186

Please sign in to comment.