immich/server/src
Imperator Ruscal a560e08693
fix: re-evaluate OIDC role claim on every login and support array values (#29991)
* fix(server): re-evaluate OIDC role claim on every login and support array values

Previously the OIDC role claim (immich_role) was only read at user
auto-registration time and only accepted as a scalar string, so admin
status never updated after the first login and array-valued role/group
claims (common with Keycloak, Entra ID, etc.) were silently ignored.

Now the role claim is normalized from either a string or an array of
strings, and existing users have their isAdmin flag synced from the
claim on every login, keeping the IdP as the source of truth for
privileges while leaving isAdmin untouched when the claim is blank.

* fix(server): use .includes() instead of .some() for role claim check

Satisfies unicorn/prefer-includes lint rule flagged by CI.

* fix(server): resolve missing role claim to standard user and fix test mock

Default the OIDC role claim to 'user' when the IdP omits it so
auto-registration doesn't crash, and add the missing getAdmin mock in the
auth.service test so it correctly simulates an existing admin rather than
the first-user-registration path.

* fix: claim sync logic

---------

Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
2026-07-21 17:21:19 -04:00
..
bin chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
commands chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
controllers chore(deps): update dependency eslint-plugin-unicorn to v72 (#30092) 2026-07-21 15:33:46 +02:00
cores chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
dtos chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
emails fix(docs): add & fix missing alt text to store badge images (#24637) 2025-12-19 09:00:31 -06:00
maintenance chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
middleware fix: zero byte image uploads (#29426) 2026-07-16 13:00:07 +02:00
queries fix(server): send id_token_hint on OIDC logout (#29720) 2026-07-21 19:19:13 +02:00
repositories fix(server): send id_token_hint on OIDC logout (#29720) 2026-07-21 19:19:13 +02:00
schema fix(server): send id_token_hint on OIDC logout (#29720) 2026-07-21 19:19:13 +02:00
services fix: re-evaluate OIDC role claim on every login and support array values (#29991) 2026-07-21 17:21:19 -04:00
utils chore(deps): update dependency eslint-plugin-unicorn to v72 (#30092) 2026-07-21 15:33:46 +02:00
workers feat: restore database backups (#23978) 2026-01-20 09:22:28 -06:00
app.common.ts feat(server): added backchannel logout api endpoint (#26235) 2026-04-17 18:45:33 +00:00
app.module.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
config.ts feat(server): hls variant configuration (#29613) 2026-07-06 14:57:48 -04:00
constants.ts feat(server): hls variant configuration (#29613) 2026-07-06 14:57:48 -04:00
database.ts feat: webhook workflow action (#29258) 2026-06-26 16:08:45 +02:00
decorators.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
enum.ts feat(server): hls variant configuration (#29613) 2026-07-06 14:57:48 -04:00
main.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
types.ts fix(deps): update typescript-projects (#29633) 2026-07-16 20:14:05 +02:00
validation.spec.ts refactor!: migrate class-validator to zod (#26597) 2026-04-14 23:39:03 +02:00
validation.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00