1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-04-17 11:23:13 +00:00

Merge pull request #742 from sasjs/issue-721

fix: add additional check for string type before converting data to lower case
This commit is contained in:
Allan Bowe
2022-07-27 20:42:48 +01:00
committed by GitHub

View File

@@ -611,7 +611,10 @@ export const throwIfError = (response: AxiosResponse) => {
throw new LoginRequiredError(response.data) throw new LoginRequiredError(response.data)
} }
if (response.data.toLowerCase() === 'invalid csrf token!') { if (
typeof response.data === 'string' &&
response.data.toLowerCase() === 'invalid csrf token!'
) {
throw new InvalidCsrfError() throw new InvalidCsrfError()
} }
break break