mirror of
https://github.com/sasjs/adapter.git
synced 2025-12-11 09:24:35 +00:00
15 lines
497 B
TypeScript
15 lines
497 B
TypeScript
export const needsRetry = (responseText: string): boolean => {
|
|
return (
|
|
!!responseText &&
|
|
((responseText.includes('"errorCode":403') &&
|
|
responseText.includes("_csrf") &&
|
|
responseText.includes("X-CSRF-TOKEN")) ||
|
|
(responseText.includes('"status":403') &&
|
|
responseText.includes('"error":"Forbidden"')) ||
|
|
(responseText.includes('"status":449') &&
|
|
responseText.includes(
|
|
"Authentication success, retry original request"
|
|
)))
|
|
);
|
|
};
|