OpenID sign-in fails authentication when email has been used on different user in the past #5255

Closed
opened 2026-02-05 11:16:49 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @Raskovo on GitHub (Jan 27, 2025).

The bug

My Immich admin user has an old email that I'm unable to change to the newer one because the new email has been in use on a different Immich user previously. I have deleted all users except my admin user, but I cannot switch admin user email to any that have been active on other users without issues.

When making the change, the logged in user remains logged in and displays the new, intended email, but any new OpenID sign-ins fail with an error saying the email already exists on a different user than the one you're attempting to sign-in to.

The OS that Immich Server is running on

Unraid 7.0

Version of Immich Server

v1.125.2

Version of Immich Mobile App

v1.125.2

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

ghcr.io/imagegenius/immich + docker mod for redis (imagegenius/mods:universal-redis)

Your .env content

N/A

Reproduction steps

  1. Have OpenID and admin user set up with an email
  2. Create different user with different email
  3. Delete the non-admin user fully (mark for immediate deletion)
  4. Change admin email to the email previously in use by the non-admin user
  5. Attempt to sign in through a new browser or on phone with the new email

Relevant log output

ApiException 400: {"message":"User already exists, but is linked to another account.","error":"Bad Request","statuscode":400,"correlationId":"kr8sd5vm"}

Additional information

This issue only presents itself when using OpenID sign-ins. I attempted to temporarily re-enable regular password sign-in, which happily accepted the changed email and allowed my admin user to sign in. The OpenID OAuth provider I'm using is Google, don't know if this applies to others or not.

Originally created by @Raskovo on GitHub (Jan 27, 2025). ### The bug My Immich admin user has an old email that I'm unable to change to the newer one because the new email has been in use on a different Immich user previously. I have deleted all users except my admin user, but I cannot switch admin user email to any that have been active on other users without issues. When making the change, the logged in user remains logged in and displays the new, intended email, but any new OpenID sign-ins fail with an error saying the email already exists on a different user than the one you're attempting to sign-in to. ### The OS that Immich Server is running on Unraid 7.0 ### Version of Immich Server v1.125.2 ### Version of Immich Mobile App v1.125.2 ### Platform with the issue - [x] Server - [x] Web - [x] Mobile ### Your docker-compose.yml content ```YAML ghcr.io/imagegenius/immich + docker mod for redis (imagegenius/mods:universal-redis) ``` ### Your .env content ```Shell N/A ``` ### Reproduction steps 1. Have OpenID and admin user set up with an email 2. Create different user with different email 3. Delete the non-admin user fully (mark for immediate deletion) 4. Change admin email to the email previously in use by the non-admin user 5. Attempt to sign in through a new browser or on phone with the new email ### Relevant log output ```shell ApiException 400: {"message":"User already exists, but is linked to another account.","error":"Bad Request","statuscode":400,"correlationId":"kr8sd5vm"} ``` ### Additional information This issue only presents itself when using OpenID sign-ins. I attempted to temporarily re-enable regular password sign-in, which happily accepted the changed email and allowed my admin user to sign in. The OpenID OAuth provider I'm using is Google, don't know if this applies to others or not.
Author
Owner

@Dreanaught commented on GitHub (Jan 30, 2025):

Please have a Look at https://github.com/immich-app/immich/discussions/11028#discussioncomment-10033812
You might have to delete the oauth token in the immich database that is assigned to the user.
The email is not the only thing that is used for authentication on immich's side.

@Dreanaught commented on GitHub (Jan 30, 2025): Please have a Look at https://github.com/immich-app/immich/discussions/11028#discussioncomment-10033812 You might have to delete the oauth token in the immich database that is assigned to the user. The email is not the only thing that is used for authentication on immich's side.
Author
Owner

@Raskovo commented on GitHub (Jan 30, 2025):

Please have a Look at #11028 (reply in thread) You might have to delete the oauth token in the immich database that is assigned to the user. The email is not the only thing that is used for authentication on immich's side.

Thank you, that was the issue. Guess my bug report ended up being tech support, sorry about that.

@Raskovo commented on GitHub (Jan 30, 2025): > Please have a Look at [#11028 (reply in thread)](https://github.com/immich-app/immich/discussions/11028#discussioncomment-10033812) You might have to delete the oauth token in the immich database that is assigned to the user. The email is not the only thing that is used for authentication on immich's side. Thank you, that was the issue. Guess my bug report ended up being tech support, sorry about that.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#5255