I am trying to create a custom AWS Amplify authentication flow with code similar to the following taken from amazon's website:
import { Auth } from 'aws-amplify';
async function signUp() {
try {
const user = await Auth.signUp({
username,
password,
attributes: {
email, // optional
phone_number, // optional - E.164 number convention
// other custom attributes
}
});
console.log({ user });
} catch (error) {
console.log('error signing up:', error);
}
}
I have a few questions about this.
How are the tokens refreshed? If I am saving the credentials in the user variable, is this automatically refreshed somehow behind the scenes?
How do I make authenticated graphql requests after I add a graphql api? With the pre-baked authentication flow it keeps track of who you are automatically. How do I do this when I log in this way?
Thanks!