react-native-auth0
react-native-auth0 copied to clipboard
Unable to remove Confirmation modal and Confirmation modal logs out the user out of session on tap of `Cancel`action button
Checklist
- [ ] The issue can be reproduced in the react-native-auth0 sample app (or N/A).
- [X] I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
- [X] I have looked into the API documentation and have not found a suitable solution or answer.
- [X] I have searched the issues and have not found a suitable solution or answer.
- [X] I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- [X] I agree to the terms within the Auth0 Code of Conduct.
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
- Setup an app with react-native-auth0 package enabled for google sign up and email + password as auth provider and enabled methods.
- Sign up , and logout
- 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