Automatic token refrehs for mutation error.
This commit is contained in:
parent
4ea3c86522
commit
4d383c6fc8
@ -49,6 +49,13 @@ const AuthAwareQueryClientProvider = ({ children }: React.PropsWithChildren) =>
|
|||||||
() =>
|
() =>
|
||||||
new QueryClient({
|
new QueryClient({
|
||||||
defaultOptions: {
|
defaultOptions: {
|
||||||
|
mutations: {
|
||||||
|
onError(error) {
|
||||||
|
if (error instanceof ExpiredTokenError) {
|
||||||
|
doRefresh()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
queries: {
|
queries: {
|
||||||
retry(failureCount, error) {
|
retry(failureCount, error) {
|
||||||
if (
|
if (
|
||||||
|
Loading…
Reference in New Issue
Block a user