Hello everyone,
I’m running into some trouble with polling triggers specifically and refreshing the token on Session Auth. Every hour the token expires and the server returns back a 401 error to Zapier. In most cases Zapier calls the Session Auth automatically and a new token is issued, however, if multiple polling triggers are set up and they each get 401 error codes then Zapier will throw a stale auth error and the user will have to re-connect their App again. I would like Zapier to not throw the Stale Auth error unless something changed on their account (i.e. Username or Password change).
Below is a snippet of code that my polling trigger runs when it receives a response from the server.
return z.request(options).then((response) => {
//response.throwForStatus();
if (response.status === 401) {
throw new z.errors.RefreshAuthError();
}
I used response.throwForStatus(); initially and then decided to try z.errors.RefreshAuthError(); if the response is a 401. However I’m still getting the stale auth. Just wanted to see if anyone had a similar problem and has a solution.