Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent forward if error #55

Open
TheNerdGuyLulu opened this issue Jul 11, 2022 · 0 comments
Open

Prevent forward if error #55

TheNerdGuyLulu opened this issue Jul 11, 2022 · 0 comments

Comments

@TheNerdGuyLulu
Copy link

TheNerdGuyLulu commented Jul 11, 2022

Context:
If the refresh token has expired, it will trigger handleError.
Inside, this condition confirms that the refresh token has expired and calls logout, clearing sessions local cache.

// If the refresh token expired, log the user out 
if (err.message === 'Unknown or invalid refresh token.') {
  await logout();
}


// Links
link: from([errorLink, refreshLink, authLink, httpLink]),

This will trigger a new request, which will fail since the token couldn't be refreshed.
If we could manually call forward, or just return a boolean (true forward, false terminate), it would give the developer more power to control the error handle.

If there's another way to accomplish this, please let me know.
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant