[PR #3444] [MERGED] refactor: improvements to the auth implementation in admin dashboard #4385

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

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/3444
Author: @joeljstephen
Created: 10/11/2023
Status: Merged
Merged: 10/16/2023
Merged by: @AndrewBastin

Base: release/2023.8.3Head: refactor/dashboard-auth


📝 Commits (10+)

  • 7ab393a refactor: abstract axios queries to a separate helper file
  • 66d96b2 chore: delete unnecessary file
  • f2e9275 chore: remove unnecessary console logs
  • 848d9fa refactor: updated urls for api and authquery helpers
  • 0bbd4ea refactor: updated auth implementation
  • a4f7919 refactor: use default axios instance
  • 67b6838 chore: improve code readability
  • 0aedb6d refactor: separate instances for rest and gql calls
  • 6294d9f refactor: removed async await from functions that do not need them
  • 85c0777 refactor: removed probable login and probable user from the auth system

📊 Changes

14 files changed (+204 additions, -403 deletions)

View changed files

📝 packages/hoppscotch-sh-admin/locales/en.json (+2 -0)
📝 packages/hoppscotch-sh-admin/src/components.d.ts (+31 -30)
📝 packages/hoppscotch-sh-admin/src/components/app/Header.vue (+2 -2)
📝 packages/hoppscotch-sh-admin/src/components/app/Login.vue (+28 -48)
📝 packages/hoppscotch-sh-admin/src/components/teams/Invite.vue (+1 -1)
packages/hoppscotch-sh-admin/src/composables/auth.ts (+0 -62)
📝 packages/hoppscotch-sh-admin/src/helpers/Email.ts (+0 -0)
📝 packages/hoppscotch-sh-admin/src/helpers/auth.ts (+74 -253)
packages/hoppscotch-sh-admin/src/helpers/axiosConfig.ts (+20 -0)
packages/hoppscotch-sh-admin/src/helpers/backend/rest/authQuery.ts (+32 -0)
packages/hoppscotch-sh-admin/src/helpers/error.ts (+0 -3)
packages/hoppscotch-sh-admin/src/helpers/errors.ts (+9 -0)
📝 packages/hoppscotch-sh-admin/src/main.ts (+3 -2)
📝 packages/hoppscotch-sh-admin/src/pages/enter.vue (+2 -2)

📄 Description

Ticket

Closes HFE-279

Description

This PR focuses on improving the auth implementation in the Admin Dashboard by removing unnecessary functions and files that do not contribute to the auth flow and improving the auth relevant functions. It also isolates all the backend queries from the auth file to separate backend helpers in the repo in order to achieve better abstraction and reusability.

Objectives

  • Remove unnecessary functions and file that make the auth implementation clunkier
  • Improve relevant auth related logic and functions
  • Achieve better abstraction by isolating the auth related backend queries from auth.ts to separate dedicated authQuery.ts helper
  • Improve the reusability of axios instance in the repo

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/3444 **Author:** [@joeljstephen](https://github.com/joeljstephen) **Created:** 10/11/2023 **Status:** ✅ Merged **Merged:** 10/16/2023 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `release/2023.8.3` ← **Head:** `refactor/dashboard-auth` --- ### 📝 Commits (10+) - [`7ab393a`](https://github.com/hoppscotch/hoppscotch/commit/7ab393abbfe8f1dbf717564c0ce81f065edd79ef) refactor: abstract axios queries to a separate helper file - [`66d96b2`](https://github.com/hoppscotch/hoppscotch/commit/66d96b29c4228101c199c136825ee1574009aa64) chore: delete unnecessary file - [`f2e9275`](https://github.com/hoppscotch/hoppscotch/commit/f2e92759ad922be8018bfac5e0088ca0abf22abc) chore: remove unnecessary console logs - [`848d9fa`](https://github.com/hoppscotch/hoppscotch/commit/848d9faed1fb5c23953d875445844ef34571b8ef) refactor: updated urls for api and authquery helpers - [`0bbd4ea`](https://github.com/hoppscotch/hoppscotch/commit/0bbd4ea3e91d613746eb58548344498792babec1) refactor: updated auth implementation - [`a4f7919`](https://github.com/hoppscotch/hoppscotch/commit/a4f7919c133108894d35cbfd52dd1ad76c269053) refactor: use default axios instance - [`67b6838`](https://github.com/hoppscotch/hoppscotch/commit/67b683813bd952ebc88c0ad1829b0d73703d16ad) chore: improve code readability - [`0aedb6d`](https://github.com/hoppscotch/hoppscotch/commit/0aedb6d8c698d3a11270a7c91c2d438559674e6c) refactor: separate instances for rest and gql calls - [`6294d9f`](https://github.com/hoppscotch/hoppscotch/commit/6294d9f405ef6159a70a6f0621ee3a08f1c97580) refactor: removed async await from functions that do not need them - [`85c0777`](https://github.com/hoppscotch/hoppscotch/commit/85c07774fdac4dc8a135e9b341fe4bf60b3a8827) refactor: removed probable login and probable user from the auth system ### 📊 Changes **14 files changed** (+204 additions, -403 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-sh-admin/locales/en.json` (+2 -0) 📝 `packages/hoppscotch-sh-admin/src/components.d.ts` (+31 -30) 📝 `packages/hoppscotch-sh-admin/src/components/app/Header.vue` (+2 -2) 📝 `packages/hoppscotch-sh-admin/src/components/app/Login.vue` (+28 -48) 📝 `packages/hoppscotch-sh-admin/src/components/teams/Invite.vue` (+1 -1) ➖ `packages/hoppscotch-sh-admin/src/composables/auth.ts` (+0 -62) 📝 `packages/hoppscotch-sh-admin/src/helpers/Email.ts` (+0 -0) 📝 `packages/hoppscotch-sh-admin/src/helpers/auth.ts` (+74 -253) ➕ `packages/hoppscotch-sh-admin/src/helpers/axiosConfig.ts` (+20 -0) ➕ `packages/hoppscotch-sh-admin/src/helpers/backend/rest/authQuery.ts` (+32 -0) ➖ `packages/hoppscotch-sh-admin/src/helpers/error.ts` (+0 -3) ➕ `packages/hoppscotch-sh-admin/src/helpers/errors.ts` (+9 -0) 📝 `packages/hoppscotch-sh-admin/src/main.ts` (+3 -2) 📝 `packages/hoppscotch-sh-admin/src/pages/enter.vue` (+2 -2) </details> ### 📄 Description ### Ticket Closes HFE-279 ### Description This PR focuses on improving the auth implementation in the Admin Dashboard by removing unnecessary functions and files that do not contribute to the auth flow and improving the auth relevant functions. It also isolates all the backend queries from the auth file to separate backend helpers in the repo in order to achieve better abstraction and reusability. ### Objectives - [x] Remove unnecessary functions and file that make the auth implementation clunkier - [x] Improve relevant auth related logic and functions - [x] Achieve better abstraction by isolating the auth related backend queries from `auth.ts` to separate dedicated `authQuery.ts` helper - [x] Improve the reusability of axios instance in the repo ### 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:55:28 +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#4385
No description provided.