1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-04-21 21:21:31 +00:00

fix: clear all cookies on session expiry and throw LoginRequiredError

This commit is contained in:
mulahasanovic
2026-04-16 10:02:36 +02:00
parent fe5f0e87b7
commit 53ebeb1cf5
2 changed files with 16 additions and 3 deletions
+2 -2
View File
@@ -607,7 +607,7 @@ ${resHeaders[0]}: ${resHeaders[1]}${
expect(requestClient['csrfToken']).toEqual({ headerName: '', value: '' })
})
it('should not loop if retry also fails with ERR_NETWORK', async () => {
it('should throw LoginRequiredError if retry also fails with ERR_NETWORK', async () => {
const networkError = {
isAxiosError: true,
code: 'ERR_NETWORK',
@@ -621,7 +621,7 @@ ${resHeaders[0]}: ${resHeaders[1]}${
await expect(
requestClient['handleError'](networkError, innerHandle)
).rejects.toEqual(networkError)
).rejects.toThrow(LoginRequiredError)
expect(innerHandle).toHaveBeenCalledTimes(1)
})