Skip to content

Conversation

brettkolodny
Copy link
Contributor

@brettkolodny brettkolodny commented Aug 19, 2025

As mentioned in the issue the problem here is the fact this endpoint is returning a 401 instead of a 200 in this specific case.

Since we actually have enough information before performing this mutation to know that it'll fail in the case of a bad auth token we'd ideally re-work the code not to call the mutation on logout and just perform the local clean up. Unfortunately it seems like the interactions that this mutation is having with React Query at large is necessary for our code to work as intended and thus it's not currently possible to move the local clean up (the code inside of the onSuccess) outside of the mutation. Shout out to @Parkreiner for helping me confirm this.

So until we can re-work the AuthProvider to be less brittle this PR changes onSuccess to onSettled so that while the mutation still fails with a 401, the local clean up still runs.

Closes #12056

@brettkolodny brettkolodny marked this pull request as ready for review August 20, 2025 16:16
@brettkolodny brettkolodny requested a review from aslilac as a code owner August 20, 2025 16:16
@brettkolodny brettkolodny requested a review from a team August 20, 2025 16:19
@brettkolodny brettkolodny merged commit ee789da into main Aug 20, 2025
32 checks passed
@brettkolodny brettkolodny deleted the brett/oauth-token-expiry-doesn-t-trigger-re-au branch August 20, 2025 19:04
@github-actions github-actions bot locked and limited conversation to collaborators Aug 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Oauth token expiry doesn't trigger re-authentication in dashboard
2 participants