Skip to content

Commit

Permalink
able to log in again
Browse files Browse the repository at this point in the history
the `signIn` function from "next-auth/react" uses `fetcher` and returns
a 404 error response. throwing that error causes an `OAUTH_CALLBACK_HANDLER_ERROR`,
which prevents users from signing in. `signIn` doesn't pass a url to `fetcher`.
the check below ensures that other errors still get thrown

- ref: #321
  • Loading branch information
alishaevn committed Feb 28, 2024
1 parent eb6224f commit 26be1d4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion utils/api/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export const fetcher = (url, token) => {
.then(res => res.data)
.catch(error => {
Sentry.captureException(error)
throw error
// the `signIn` function from "next-auth/react" uses `fetcher` and returns a 404 error response. throwing that error causes an
// `OAUTH_CALLBACK_HANDLER_ERROR`, which prevents users from signing in. `signIn` doesn't pass a url to `fetcher`. the check below
// ensures that other errors still get thrown
if (error.config.url !== null) throw error
})
}

Expand Down

0 comments on commit 26be1d4

Please sign in to comment.