Closed marcuscapacity closed 5 months ago
@marcuscapacity Thank you for your report. Your example code appears to be using Amplify v5 APIs, while you have a dependency on Amplify v6 (which introduced functional APIs across the library). I'd recommend taking a look at our official v6 Auth documentation: https://docs.amplify.aws/react/build-a-backend/auth/enable-sign-up/
Additionally, looking at your dependencies you should be able to remove amazon-cognito-identity-js
, which is no longer required for v6.
Closing this issue as we have not heard back from you. If you are still experiencing this, please feel free to reply back and provide any information previously requested and we'd be happy to re-open the issue.
Thank you!
Before opening, please confirm:
JavaScript Framework
React Native
Amplify APIs
Authentication
Amplify Version
v6
Amplify Categories
auth
Backend
Amplify CLI
Environment information
Describe the bug
{ Auth } is not correctly being read as an import from 'aws-amplify'. There are four files 'aws-amplify' stems from:
Not sure if that in itself is incorrect?
Because of this, Auth.signIn(username, password); is not working. Although the IDE does not have an error when using the .signIn and .signUp methods, right clicking them takes you to their appropriate files:
This leads to the error message being caught in this try/catch block:
Expected behavior
The user, who I have managed to signUp with as shown by the user Pool in Cognito showing my user's email address, should be able to sign in.
Reproduction steps
I have followed all the steps here: https://blog.logrocket.com/aws-amplify-react-native-tutorial-examples/ But since withAuthenticator had a problem when trying to sign in but did not show any useful error messages, I have converted my code to use the auth methods directly (see code snippet below)
Code Snippet
Log output
aws-exports.js
Manual configuration
Additional configuration
Mobile Device
No response
Mobile Operating System
android
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response