feat(server): add configurable OAuth prompt parameter#26755
feat(server): add configurable OAuth prompt parameter#26755sparsh985 wants to merge 4 commits intoimmich-app:mainfrom
Conversation
|
Please fill out the complete PR template |
@bo0tzz I've filled out the template. Do let me know incase it looks alright. |
danieldietzler
left a comment
There was a problem hiding this comment.
This seems fine to me. Could you please look into whether you can get an e2e test for this (we already have a oauth.e2e-spec.ts). Also, note our contributing guidelines https://github.com/immich-app/immich/blob/main/CONTRIBUTING.md#use-of-generative-ai :)
|
Oh and also, generate the open API files please ( |
Hi @danieldietzler, I've added the e2e test for this. Thanks for the guidelines, I'll limit my use for LLM and use it as minimally as possible, since I'm still learning things.
I did generate those already, do they look wrong? |
|
The open-api check (https://github.com/immich-app/immich/actions/runs/22958235237/job/66654018513?pr=26755) is failing, so it must be outdated somehow. Maybe try running |
Add a `prompt` field to the OAuth system config, allowing admins to configure the OIDC `prompt` parameter (e.g. `select_account`, `login`, `consent`). Defaults to empty string (no prompt sent), preserving backward compatibility. This is useful for providers like Google where users want to be prompted to select an account when multiple accounts are signed in. Discussed in immich-app#20762
c79708b to
d7377a9
Compare
|
I've made the prompt field optional in the DTO to avoid a breaking API change. Existing clients that don't send prompt will use the default (empty string), which preserves current behavior. The field is fully functional when explicitly set. |
Description
Add a configurable
promptfield to the OAuth system config, allowing admins to set the OIDCpromptparameter (e.g.select_account,login,consent) from the admin settings.This addresses a common issue where users with multiple Google accounts are not prompted to select an account during OAuth login. By making this configurable (rather than hardcoding), it remains compatible with OIDC providers that don't support
select_account(the OIDC spec marks it as optional).Defaults to an empty string, which preserves current behavior (no
promptparameter sent).Discussed in #20762
How Has This Been Tested?
pnpm --filter immich run check— TypeScript type check passespnpm --filter immich run test— All unit tests passAPI Changes
The
SystemConfigOAuthDtonow includes a newpromptfield (string, defaults to""). This affects the/api/system-configendpoint.Checklist:
src/services/uses repositories implementations for database calls, filesystem operations, etc.src/repositories/is pretty basic/simple and does not have any immich specific logic (that belongs insrc/services/)Please describe to which degree, if any, an LLM was used in creating this pull request.
An LLM (Claude) was used to assist with implementing the code changes.