I am using react-native and the out of the box aws-amplify-react-native to sigin, signup users. Users are able to authenticate successfully but getting the following error in the signin form "no current user"
I pumped up the log level to debug in the application. I can see the user successfully authenticate and I get back the JWT token but I see the following in the logs:
[DEBUG] 22:47.149 AuthClass - Failed to get user from user pool
[ERROR] 22:47.154 AuthClass - Failed to get the signed in user No current user
[DEBUG] 22:47.161 AuthPiece - No current user
Below is a snippet of my code:
import { ConfirmSignIn, ConfirmSignUp, ForgotPassword, RequireNewPassword, SignIn, SignUp, VerifyContact, withAuthenticator } from 'aws-amplify-react-native';
const RootStack = createStackNavigator(
{
Login: LoginScreen,
Main: MainScreen,
Customer: CustomerScreen,
Reports: ReportsScreen,
Signup: SignupScreen
},
{
initialRouteName: 'Main',
}
);
const AppContainer = createAppContainer(RootStack);
export class App extends React.Component {
render() {
return (
<AppContainer />
);
}
}
export default withAuthenticator(App);
When I run my app. I see the default Sign In form for Amplify, I use it to enter username and password and then click on "SIGN IN" button which does successfully authenticate but I get the "No current user error" as shown above.
I had the similar problem. I removed the cookie storage block from the configure method and it worked.
Are you using the cookieStore? If true, do you use the secure flag? If so, change its value to false
in the development environment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With