Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

Amplify React-Native Auth sign in not staying signed in?

$
0
0

Using amplify and React-Native with Expo, my team built a backend and api layer before I was brought on, so I had to import them into amplify. Not sure if that's important, but due to how much amplify seems to not like this approach thought it might be relevant.

The amplify libraries were working until a few days ago, when suddenly the user would log in using the amplify Auth.signIn function, which would return the user object after awaiting it, and showed successful log in (ie, the object was returned with all of its info and tokens), but doesn't seem to be stored anywhere by amplify anymore. When an api call is made I get an Error: No credentials, applicationId or region error, and when I call Auth.currentSession or any other thing to see the current status of the auth info, they all return null, even within seconds of having received the valid login object.

the code to sign in looks like this:

                          const user = await Auth.signIn(username, password);                          console.log(JSON.stringify(user));

after this, the app moves to a new screen where it attempts to load some info needed via an appsync call, but then receives the above mentioned error, but even if we try something within the same screen, we get back the error or null user objects.


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>