[PR #3385] [MERGED] fix: blank screen in admin dashboard when failing to refresh tokens or when cookies are expired and user not fully logged out in such cases #4368

Closed
opened 2026-03-17 01:54:39 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/3385
Author: @joeljstephen
Created: 9/22/2023
Status: Merged
Merged: 10/9/2023
Merged by: @AndrewBastin

Base: release/2023.8.2Head: fix/dashboard-auth-errors


📝 Commits (5)

  • 84b2ef6 fix: dashboard logs out user when cookie expires or is unauthorized
  • fa08ab9 fix: handles the 401 error thrown when trying to refresh tokens
  • 55cdd03 chore: updated wrong logic when returning state in refresh token function
  • 544cb83 feat: introduced auth exchange to urql client to check for errors on each backend call
  • 985a214 fix: prevent multiple window reloads

📊 Changes

5 files changed (+2926 additions, -550 deletions)

View changed files

📝 packages/hoppscotch-sh-admin/package.json (+2 -1)
📝 packages/hoppscotch-sh-admin/src/components.d.ts (+30 -33)
📝 packages/hoppscotch-sh-admin/src/helpers/auth.ts (+45 -25)
📝 packages/hoppscotch-sh-admin/src/main.ts (+26 -2)
📝 pnpm-lock.yaml (+2823 -489)

📄 Description

Ticket

Closes HFE-222

Description

This PR focuses on fixing an issue in the Admin Dashboard where the user isn't fully logged out ( only the frontend handles the situation without sending the appropriate calls to the backend ) and is either shown the login page or a blank screen when any of the following conditions occur:

  • User is Unauthorised
  • Cookies are expired
  • Attempting to refresh the token throws a 401 error

Objectives

  • Fix the issue where a blank screen is shown when cookies are expired
  • Fix the auth issue where user is not logged out when unauthorised or when cookies have expired
  • Fix the issue where attempting to refresh the tokens throws a 401 error and results in a blank screen

Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/3385 **Author:** [@joeljstephen](https://github.com/joeljstephen) **Created:** 9/22/2023 **Status:** ✅ Merged **Merged:** 10/9/2023 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `release/2023.8.2` ← **Head:** `fix/dashboard-auth-errors` --- ### 📝 Commits (5) - [`84b2ef6`](https://github.com/hoppscotch/hoppscotch/commit/84b2ef6a7e5dcb291191fe2a8b61834661b51134) fix: dashboard logs out user when cookie expires or is unauthorized - [`fa08ab9`](https://github.com/hoppscotch/hoppscotch/commit/fa08ab9375db75ba88b555e8c264fb0ddeb97bc5) fix: handles the 401 error thrown when trying to refresh tokens - [`55cdd03`](https://github.com/hoppscotch/hoppscotch/commit/55cdd03db77f9b3fc64c5cdac17df09eb943b25b) chore: updated wrong logic when returning state in refresh token function - [`544cb83`](https://github.com/hoppscotch/hoppscotch/commit/544cb83c350977400bd46e87e15f8cbe06607e48) feat: introduced auth exchange to urql client to check for errors on each backend call - [`985a214`](https://github.com/hoppscotch/hoppscotch/commit/985a21493602cbf5ec4880b4701a12ddf2c0483e) fix: prevent multiple window reloads ### 📊 Changes **5 files changed** (+2926 additions, -550 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-sh-admin/package.json` (+2 -1) 📝 `packages/hoppscotch-sh-admin/src/components.d.ts` (+30 -33) 📝 `packages/hoppscotch-sh-admin/src/helpers/auth.ts` (+45 -25) 📝 `packages/hoppscotch-sh-admin/src/main.ts` (+26 -2) 📝 `pnpm-lock.yaml` (+2823 -489) </details> ### 📄 Description ### Ticket Closes HFE-222 ### Description This PR focuses on fixing an issue in the Admin Dashboard where the user isn't fully logged out ( only the frontend handles the situation without sending the appropriate calls to the backend ) and is either shown the login page or a blank screen when any of the following conditions occur: - User is Unauthorised - Cookies are expired - Attempting to refresh the token throws a 401 error ### Objectives - [x] Fix the issue where a blank screen is shown when cookies are expired - [x] Fix the auth issue where user is not logged out when unauthorised or when cookies have expired - [x] Fix the issue where attempting to refresh the tokens throws a 401 error and results in a blank screen ### Checks <!-- Make sure your pull request passes the CI checks and do check the following fields as needed - --> - [x] My pull request adheres to the code style of this project - [ ] My code requires changes to the documentation - [ ] I have updated the documentation as required - [x] All the tests have passed --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 01:54:39 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#4368
No description provided.