I'm using Amplify Flutter to implement user authentication in my Flutter app and can't figure out the following two things:
Auto-login: How do I implement auto-login so that users remain logged in when closing and reopening the app over time (i.e. the app remains in logged-in state indefinitely unless users specifically log out of the app)?
authToken: When the user is logged in, how do I get the authToken needed to add to my outgoing api requests (from the app to my aws backend)?
Been scouring the internet (and reading through the official docs) for solutions but can't seem to find much info on this or figure it out.
I was experiencing this issue as well and came across Amplify's
Authenticator
widget.It's pretty easy to setup and works very well with little to no effort from the developer. It infers configuration from your Amplify config dart file, even allows for extensive customization over the UI's behavior.
Full docs can be found here