[PR #3928] [MERGED] refactor(web,server): use feature flags for oauth #10166

Closed
opened 2026-02-05 14:17:02 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/immich-app/immich/pull/3928
Author: @jrasm91
Created: 8/31/2023
Status: Merged
Merged: 9/1/2023
Merged by: @alextran1502

Base: mainHead: refactor/oauth


📝 Commits (3)

  • 96b352f refactor: oauth to use feature flags
  • d2b2f5b chore: open api
  • c92a75f chore: e2e test for authorize endpoint

📊 Changes

26 files changed (+660 additions, -110 deletions)

View changed files

📝 cli/src/api/open-api/api.ts (+100 -4)
📝 mobile/openapi/.openapi-generator/FILES (+3 -0)
📝 mobile/openapi/README.md (+2 -0)
📝 mobile/openapi/doc/OAuthApi.md (+44 -0)
mobile/openapi/doc/OAuthAuthorizeResponseDto.md (+15 -0)
📝 mobile/openapi/lib/api.dart (+1 -0)
📝 mobile/openapi/lib/api/o_auth_api.dart (+53 -1)
📝 mobile/openapi/lib/api_client.dart (+2 -0)
mobile/openapi/lib/model/o_auth_authorize_response_dto.dart (+98 -0)
📝 mobile/openapi/test/o_auth_api_test.dart (+7 -0)
mobile/openapi/test/o_auth_authorize_response_dto_test.dart (+27 -0)
📝 server/immich-openapi-specs.json (+44 -0)
📝 server/src/domain/auth/auth.service.ts (+32 -3)
📝 server/src/domain/auth/dto/oauth-config.dto.ts (+0 -2)
📝 server/src/domain/auth/response-dto/oauth-config-response.dto.ts (+4 -0)
📝 server/src/immich/controllers/oauth.controller.ts (+8 -0)
server/test/e2e/oauth.e2e-spec.ts (+42 -0)
📝 web/src/api/open-api/api.ts (+100 -4)
📝 web/src/api/utils.ts (+10 -1)
📝 web/src/lib/components/forms/login-form.svelte (+39 -36)

...and 6 more files

📄 Description

In this PR:

  • Use feature flags for OAuth
  • Remove calls to generateConfig
  • Add a new endpoint to get an authorization url (POST /api/oauth/authorize)
  • Remove custom OAuth button text usage
  • Lazily get the authorize url with a request to POST /api/oauth/authorize

Tested Scenarios:

  • Password and OAuth disabled = no login
  • Password enabled = login button
  • OAuth enabled = "Login" button, which triggers oauth and works
  • OAuth and Password enabled = "Login" + "Login with OAuth" separated with a vertical line, both work
  • User settings link and unlink OAuth account
  • AutoLaunch=true auto logs the user in when navigating to /auth/login

🔄 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/immich-app/immich/pull/3928 **Author:** [@jrasm91](https://github.com/jrasm91) **Created:** 8/31/2023 **Status:** ✅ Merged **Merged:** 9/1/2023 **Merged by:** [@alextran1502](https://github.com/alextran1502) **Base:** `main` ← **Head:** `refactor/oauth` --- ### 📝 Commits (3) - [`96b352f`](https://github.com/immich-app/immich/commit/96b352fb694248dd6600d95b7fadf9df5183b297) refactor: oauth to use feature flags - [`d2b2f5b`](https://github.com/immich-app/immich/commit/d2b2f5b858c0f0e3d5fc1b298fabdebb44818e5b) chore: open api - [`c92a75f`](https://github.com/immich-app/immich/commit/c92a75fadbafbaad3a00ca2e4dd9c06cf8f82ad1) chore: e2e test for authorize endpoint ### 📊 Changes **26 files changed** (+660 additions, -110 deletions) <details> <summary>View changed files</summary> 📝 `cli/src/api/open-api/api.ts` (+100 -4) 📝 `mobile/openapi/.openapi-generator/FILES` (+3 -0) 📝 `mobile/openapi/README.md` (+2 -0) 📝 `mobile/openapi/doc/OAuthApi.md` (+44 -0) ➕ `mobile/openapi/doc/OAuthAuthorizeResponseDto.md` (+15 -0) 📝 `mobile/openapi/lib/api.dart` (+1 -0) 📝 `mobile/openapi/lib/api/o_auth_api.dart` (+53 -1) 📝 `mobile/openapi/lib/api_client.dart` (+2 -0) ➕ `mobile/openapi/lib/model/o_auth_authorize_response_dto.dart` (+98 -0) 📝 `mobile/openapi/test/o_auth_api_test.dart` (+7 -0) ➕ `mobile/openapi/test/o_auth_authorize_response_dto_test.dart` (+27 -0) 📝 `server/immich-openapi-specs.json` (+44 -0) 📝 `server/src/domain/auth/auth.service.ts` (+32 -3) 📝 `server/src/domain/auth/dto/oauth-config.dto.ts` (+0 -2) 📝 `server/src/domain/auth/response-dto/oauth-config-response.dto.ts` (+4 -0) 📝 `server/src/immich/controllers/oauth.controller.ts` (+8 -0) ➕ `server/test/e2e/oauth.e2e-spec.ts` (+42 -0) 📝 `web/src/api/open-api/api.ts` (+100 -4) 📝 `web/src/api/utils.ts` (+10 -1) 📝 `web/src/lib/components/forms/login-form.svelte` (+39 -36) _...and 6 more files_ </details> ### 📄 Description In this PR: - Use feature flags for OAuth - Remove calls to `generateConfig` - Add a new endpoint to get an authorization url (`POST /api/oauth/authorize`) - Remove custom OAuth button text usage - Lazily get the authorize url with a request to `POST /api/oauth/authorize` Tested Scenarios: - Password and OAuth disabled = no login - Password enabled = login button - OAuth enabled = "Login" button, which triggers oauth and works - OAuth and Password enabled = "Login" + "Login with OAuth" separated with a vertical line, both work - User settings link and unlink OAuth account - AutoLaunch=true auto logs the user in when navigating to `/auth/login` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 14:17:02 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#10166