[PR #3646] [MERGED] feat: dynamically load enabled auth providers #4469

Closed
opened 2026-03-17 02:00:08 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/3646
Author: @amk-dev
Created: 12/13/2023
Status: Merged
Merged: 12/13/2023
Merged by: @AndrewBastin

Base: release/2023.12.0Head: feat/conditional-auth-from-api


📝 Commits (4)

  • e1dc726 chore: organize auth platform things to platform/auth/auth.platform.ts
  • bab67bd refactor: remove root v-if on Login.vue
  • 2fcff19 feat: load enabled auth methods dynamically
  • 74464c8 chore: load additonalLoginItems and verify if they're enabled

📊 Changes

14 files changed (+160 additions, -104 deletions)

View changed files

📝 packages/hoppscotch-common/locales/en.json (+2 -1)
📝 packages/hoppscotch-common/src/components/app/ActionHandler.vue (+1 -1)
📝 packages/hoppscotch-common/src/components/firebase/Login.vue (+95 -83)
📝 packages/hoppscotch-common/src/platform/auth.ts (+6 -0)
📝 packages/hoppscotch-selfhost-web/package.json (+2 -1)
📝 packages/hoppscotch-selfhost-web/src/main.ts (+1 -1)
packages/hoppscotch-selfhost-web/src/platform/auth/auth.api.ts (+30 -0)
📝 packages/hoppscotch-selfhost-web/src/platform/auth/auth.platform.ts (+2 -0)
📝 packages/hoppscotch-selfhost-web/src/platform/collections/collections.platform.ts (+1 -1)
📝 packages/hoppscotch-selfhost-web/src/platform/environments/environments.platform.ts (+1 -1)
📝 packages/hoppscotch-selfhost-web/src/platform/history/history.platform.ts (+1 -1)
📝 packages/hoppscotch-selfhost-web/src/platform/settings/settings.platform.ts (+1 -1)
📝 packages/hoppscotch-selfhost-web/src/platform/tabState/tabState.platform.ts (+1 -1)
📝 pnpm-lock.yaml (+16 -12)

📄 Description

Fixes HFE-343

Changes

  1. This PR loads the enabled auth providers dynamically from the backend rest endpoint. previously we loaded it from .env files.

  2. Auth platform definition has a new field getAllowedAuthProviders. this will be used to retrieve the enabled auth providers.

  3. nowadditionalLoginItems doesnt need platform level filtering. the platform can give the definition for the login item entry. and it will be shown/hidden based on the value from getAllowedAuthProviders. eg: in enterprise edition for saml, we do not need to filter based on the env value. we can give the definition anyway and it will be shown/hidden based on the value from the api.

Chores

  1. This PR removes the root v-if present on Login.vue, which was making using hooks like 'onMounted' unintuitive.

  2. Renamed 'platform/auth.ts' to 'platform/auth.platform.ts' to organize things a little better.

Note

This Implementation will also introduce small changes to our central & enterprise repos.


🔄 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/3646 **Author:** [@amk-dev](https://github.com/amk-dev) **Created:** 12/13/2023 **Status:** ✅ Merged **Merged:** 12/13/2023 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `release/2023.12.0` ← **Head:** `feat/conditional-auth-from-api` --- ### 📝 Commits (4) - [`e1dc726`](https://github.com/hoppscotch/hoppscotch/commit/e1dc726544d629c5baa315c1422180a9f4e32732) chore: organize auth platform things to platform/auth/auth.platform.ts - [`bab67bd`](https://github.com/hoppscotch/hoppscotch/commit/bab67bd99cbf3c163097c1da9e315e6f9c1e68d1) refactor: remove root v-if on Login.vue - [`2fcff19`](https://github.com/hoppscotch/hoppscotch/commit/2fcff193685a8c35fb78f5d87c9c2c399d3179b2) feat: load enabled auth methods dynamically - [`74464c8`](https://github.com/hoppscotch/hoppscotch/commit/74464c8efc9c1e10e036f2cd1dede1e912872c70) chore: load additonalLoginItems and verify if they're enabled ### 📊 Changes **14 files changed** (+160 additions, -104 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/locales/en.json` (+2 -1) 📝 `packages/hoppscotch-common/src/components/app/ActionHandler.vue` (+1 -1) 📝 `packages/hoppscotch-common/src/components/firebase/Login.vue` (+95 -83) 📝 `packages/hoppscotch-common/src/platform/auth.ts` (+6 -0) 📝 `packages/hoppscotch-selfhost-web/package.json` (+2 -1) 📝 `packages/hoppscotch-selfhost-web/src/main.ts` (+1 -1) ➕ `packages/hoppscotch-selfhost-web/src/platform/auth/auth.api.ts` (+30 -0) 📝 `packages/hoppscotch-selfhost-web/src/platform/auth/auth.platform.ts` (+2 -0) 📝 `packages/hoppscotch-selfhost-web/src/platform/collections/collections.platform.ts` (+1 -1) 📝 `packages/hoppscotch-selfhost-web/src/platform/environments/environments.platform.ts` (+1 -1) 📝 `packages/hoppscotch-selfhost-web/src/platform/history/history.platform.ts` (+1 -1) 📝 `packages/hoppscotch-selfhost-web/src/platform/settings/settings.platform.ts` (+1 -1) 📝 `packages/hoppscotch-selfhost-web/src/platform/tabState/tabState.platform.ts` (+1 -1) 📝 `pnpm-lock.yaml` (+16 -12) </details> ### 📄 Description Fixes HFE-343 **Changes** 1. This PR loads the enabled auth providers dynamically from the backend rest endpoint. previously we loaded it from .env files. 2. `Auth platform definition` has a new field `getAllowedAuthProviders`. this will be used to retrieve the enabled auth providers. 3. now`additionalLoginItems` doesnt need platform level filtering. the platform can give the definition for the login item entry. and it will be shown/hidden based on the value from `getAllowedAuthProviders`. eg: in enterprise edition for saml, we do not need to filter based on the env value. we can give the definition anyway and it will be shown/hidden based on the value from the api. **Chores** 1. This PR removes the root v-if present on Login.vue, which was making using hooks like 'onMounted' unintuitive. 2. Renamed 'platform/auth.ts' to 'platform/auth.platform.ts' to organize things a little better. **Note** This Implementation will also introduce small changes to our `central` & `enterprise` repos. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:00:08 +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#4469
No description provided.