I have already get the access Token and user information using the API end point but now I want to login into please help me how I can login into and get currentAuthenticatedUser, I have not login with user and pass word because I have using Facebook/Google Web UI login into aws.
Hub.listen("auth", ({ payload: { event, data } }) => {
switch (event) {
case "signIn":
Auth.currentAuthenticatedUser().then(user => {
this.setState({ user, error: null, loading: false });
debugger
});
break;
case "signOut":
this.setState({ user: null, error: null, loading: false });
debugger
break;
}
});
2
Answers
Could you try this?
Please try below code, it may be work for you:
`
`