Skip to content

Commit 5ce4059

Browse files
authored
Merge pull request #994 from navikt/tech/formio-token-expired-440
Formio api returns http status 440 when token is expired
2 parents dc2e0f1 + 1506c17 commit 5ce4059

File tree

1 file changed

+2
-1
lines changed
  • packages/shared-components/src/api/util/http

1 file changed

+2
-1
lines changed

packages/shared-components/src/api/util/http/http.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ const put = async <T>(url: string, body: object, headers?: FetchHeader, opts?: F
8282

8383
const handleResponse = async (response: Response, opts?: FetchOptions) => {
8484
if (!response.ok) {
85-
if (response.status === 401) {
85+
// Formio API server returns status 440 when token is expired
86+
if (response.status === 401 || response.status === 440) {
8687
throw new UnauthenticatedError(response.statusText);
8788
}
8889

0 commit comments

Comments
 (0)