Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to remove Confirmation modal and Confirmation modal logs out the user out of session on tap of Cancelaction button #882

Open
5 of 6 tasks
wishup-agrit opened this issue Mar 27, 2024 · 0 comments
Labels
bug This points to a verified bug in the code

Comments

@wishup-agrit
Copy link

wishup-agrit commented Mar 27, 2024

Checklist

Description

I have implemented the Auth0 with google as a provider and email +password method of authentication.

Firstly I followed the doc of toggling the confirmation modal off, but it does not work as expected and still prompts the user on action of signin and signOut.
Authentication works as expected, but the logout feature of the the API isn't working as expected.
On tap of cancel, it sessions out the user and as I have implemented, Please let me know if there is something I am missing .

Reproduction

  1. Setup an app with react-native-auth0 package enabled for google sign up and email + password as auth provider and enabled methods.
  2. Sign up , and logout
  3. login and logout.

this is the handler that is invoked on tap of the button, I want to logout. It prompts the user, which is unwanted at first place and then on tap of cancel it logs the session out.

 const handleLogout = async () => {
    try {
      const credentials = await clearCredentials();

      const session = await clearSession();

      const credential = await getCredentials();

      if (!credential?.accessToken) {
        client.resetStore();
        setUser({});
        setAccessToken('');
        setOrgId('');
        setRefreshToken('');
        setOnboardingChoices({});
      }
    } catch (err) {
      Toast.show('Error in Account Logout' + error?.message, {
        duration: Toast.durations.SHORT,
        position: Toast.positions.BOTTOM,
        textColor: 'white',
        backgroundColor: colors?.dark?.green,
        shadow: true,
        animation: true,
        hideOnPress: true,
        delay: 0,
      });
    }
  };

Additional context

No response

react-native-auth0 version

"^3.1.0",

React Native version

"0.73.4"

Expo version

"~50.0.8",

Platform

iOS

Platform version(s)

iPhone SE(3rd Generation), iPhone 15 Pro Max - iOS 17.2

@wishup-agrit wishup-agrit added the bug This points to a verified bug in the code label Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This points to a verified bug in the code
Projects
None yet
Development

No branches or pull requests

1 participant