Skip to content

Commit

Permalink
Added comment to justify expected error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
NSeydoux committed Oct 30, 2020
1 parent a22a607 commit 2ed5a4a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/browser/src/authenticatedFetch/fetchFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ async function buildDpopFetchOptions(
}

function isExpectedAuthError(statusCode: number): boolean {
// As per https://tools.ietf.org/html/rfc7235#section-3.1 and https://tools.ietf.org/html/rfc7235#section-3.1,
// a response failing because the provided credentials aren't accepted by the
// server can get a 401 or a 403 response.
return [401, 403].includes(statusCode);
}

Expand Down

0 comments on commit 2ed5a4a

Please sign in to comment.