Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(console): fix unexpected 401 error toasts #6416

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/console/src/hooks/use-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

// This is what will happen when the user still has the legacy refresh token without
// organization scope. We should sign them out and redirect to the sign in page.
// TODO: This is a temporary solution to prevent the user from getting stuck in Console,

Check warning on line 65 in packages/console/src/hooks/use-api.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

packages/console/src/hooks/use-api.ts#L65

[no-warning-comments] Unexpected 'todo' comment: 'TODO: This is a temporary solution to...'.
// which can be removed after all legacy refresh tokens are expired, i.e. after Jan 10th,
// 2024.
if (response.status === 403 && data.message === 'Insufficient permissions.') {
Expand Down Expand Up @@ -157,6 +157,7 @@
if (
isCloud &&
isDevFeaturesEnabled &&
isAuthenticated &&
['POST', 'PUT', 'DELETE'].includes(request.method) &&
response.status >= 200 &&
response.status < 300
Expand Down
Loading