mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-05 03:30:05 +00:00
15 lines
495 B
TypeScript
15 lines
495 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'
|
|
)))
|
|
)
|
|
}
|