Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dbAuth: Catch fetch failure in getToken (#9119)
We have this comment in `useToken()` https://github.com/redwoodjs/redwood/blob/4b734d30c6830172194a2518ae0c2cbf6f1a0904/packages/auth/src/AuthProvider/useToken.ts#L7-L14 And for example our Netlify auth implementation does this: https://github.com/redwoodjs/redwood/blob/4b734d30c6830172194a2518ae0c2cbf6f1a0904/packages/auth-providers/netlify/web/src/netlify.ts#L68-L78 But dbAuth let the exception slip through to `useToken`. This PR adds a `catch` to the promise and returns `null`, just like Netlify (and others) Before merging this though, I need to make sure I'm not undoing the fix @standup75 did in #8284 (@standup75 can you say off the top of your head if my code will work or not?)
- Loading branch information