Hi All,
I am having issues running a mutation the @requiresAuth immediately after a user logs in.
Once i get a successful response from the login I attempt to call my mutation and will get an error - ‘UNAUTHENTICATED’ error ‘You don’t have permission to do that.’ occurred in claimVideoMutation
I thought for some reason time may be the solution. So I did a setTimeout to run the mutation every second until it worked. It turns out after about 5 seconds the mutation worked.
I then recalled this ticket - When using dbAuth, don't call `getToken` multiple times per page by cannikin · Pull Request #5816 · redwoodjs/redwood · GitHub (which was an excellent change) but I wonder if this is causing my issue.
So, I attempted to getToken() and also tried reauthenticate() to see if i could get the backend up to date but that did not do the trick.
Does anyone have thoughts on where I may be going wrong?