I figured this out a while back... In short I was being a bit dumb...
The useEffect hook was worthless, because when the user is returned from to the app after successful authorization, they are not immediately recognized as being signed in, so an Auth.currentAuthenticatedUser() will throw an error.
One problem I had (still have) is it takes about 3 seconds after returning from the Auth provider to for the data.payload.event, signIn, to be "heard" by the hub. This delay only seems to occur on a mobile.
Anyhow, to provide better UX, I return the user to a page that has a, "Continue with" button, that sends them to a loading page until the signIn event occurs and I can trigger the app into action or handle an error from that point on.
Still way too many clicks and popping in/out of windows, which I'm thinking about how to reduce.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I figured this out a while back... In short I was being a bit dumb...
The useEffect hook was worthless, because when the user is returned from to the app after successful authorization, they are not immediately recognized as being signed in, so an
Auth.currentAuthenticatedUser()
will throw an error.One problem I had (still have) is it takes about 3 seconds after returning from the Auth provider to for the
data.payload.event
,signIn
, to be "heard" by the hub. This delay only seems to occur on a mobile.Anyhow, to provide better UX, I return the user to a page that has a, "Continue with" button, that sends them to a loading page until the
signIn
event occurs and I can trigger the app into action or handle an error from that point on.Still way too many clicks and popping in/out of windows, which I'm thinking about how to reduce.