amplify-js: Unable to re-login to android using react-native after logout in social signin(Google)

Before opening, please confirm:

JavaScript Framework

React Native

Amplify APIs

Authentication

Amplify Categories

auth

Environment information

Using the Google federatedSignIn, the app is able to login to aws at first. But if signout and try to re-login the listen doesnot trigger resulting no further progress and need to completely close the app and reopen to again login to the social auth

Login to Google with

Auth.federatedSignIn({
    provider: CognitoHostedUIIdentityProvider.Google
  });

Listening to logging action

 Hub.listen('auth', ({payload: {event}}) => {
      switch (event) {
        case 'signIn':
          break;
        case 'cognitoHostedUI':
          login();
          break;
        case 'signOut':
          break;
        case 'signIn_failure':
          break;
        case 'cognitoHostedUI_failure':      
          break;
        default:
          setIsLoading(false);
          break;
      }
    });

Signout with

Auth.signOut({global: true});

to reproduce:

  1. Signin with Google
  2. Signout
  3. Re-signin (Fails)
  4. Close the app
  5. Re-open the app
  6. Signin with google (Success)

What found is At step 1. Hub.listen is working At step 3 Hub.Listen isn’t working At step 6 Hub.listen works

Describe the bug

The bug is described on this issue but not worked for android solution

https://github.com/aws-amplify/amplify-js/issues/7555

This is Bug on REACT-NATIVE

This bug is faced after signout on the same session of the app and reopening the app doesnot face the problem

Expected behavior

The code should be able to listen to sign at any number of signouts

Reproduction steps

  1. Login with Auth.federatedSignIn({ provider: CognitoHostedUIIdentityProvider.Google })
  2. Signout with Auth.signout();
  3. ReLogin with Auth.federatedSignIn({ provider: CognitoHostedUIIdentityProvider.Google })

Code Snippet

// Put your code below this line.

Log output

// Put your logs below this line


aws-exports.js

No response

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

Android

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

Unable to re-login to android using react-native after logout in social signin(Google)

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 3
  • Comments: 16 (5 by maintainers)

Most upvoted comments

Hi @nadetastic Is there any update regrading this issue? We are having this issue and we are on the end of releasing schedule.

Thank you in advance!

yeah this is happening for us on android following are the steps

1: User open apps and logins via Google Signin (Auth.federatedSignIn({provider: CognitoHostedUIIdentityProvider.Google})); 2: Hub listens and enters Home screen 3: User Signout using (Auth.signOut({global:true)); 4: When he user tries to log in again Google Signin (Auth.federatedSignIn({provider: CognitoHostedUIIdentityProvider.Google})), Hub.listen never triggers event without reloading the app. 5: If User closes app and open again it works, but when user signs out it breaks again and user must reload the app.

@nadetastic it is still reproducible.