user.firstName[0] + user.lastName[0]).toUpperCase is not a function
Got this as soon as i clicked "Login with OAuth"

52 Replies
And now i'm unable to log into the account. Even after Immich restart it keeps the same thing
Seems like a bug. Does your user in oauth have a first and last name set?
nope
If not, I think setting those should let you log in for now.
just username, email and password
Can you create a github issue for this as well?
sure, i'm just going to try edit the user in Keycloak and will let you know
nope, same issue
i restarted immich and still the same error even if i set the first and last name
Hmm, very weird
I can't figure out any scenario where it would be possible to get this error
What version of Immich are you on?
@jrasm91 @Alex any idea? I figured this was just
firstName
or lastName
being null, but they're notnull in the db so that shouldn't be possible. I've also tried setting them to an empty string but that doesn't crash either (the avatar just says 'undefined')1.60.0
currently latest
yesterday i were deploying the immich
Can you maybe try with a new user with the name set? Maybe it only happens on first login 🤔
I don't think i can get rid of that error on Immich end. After restarting the Immich and pressing F5 or targeting the base url (immich.local.dashrave.eu in my case) it automatically throw this error without even giving me the login screen.
Thankfully i didn't have any photos uploaded yet because i was aware someting like this can happen
Clearing your cookies should fix that I think
I just tried the other browser and i was able to get to login screen. As i filled up the First and Last name, saved the changes, i tried logging in again but same behavior. On first just infinite Immich login bar and after F5-ing the site i get the same error

Can you access the database?
this is the Keycloak UI

i surely can
Or do a curl request to update the user?
You need to change the user first and last name in immich
It only copies the name from keycloak the first time you sign in
Ah, right. Do i need something like PHPMyAdmin to access the database?
If you're comfortable with just a cli, you can use psql
I'm pretty okay with CLI
It is the
postgresql-client-common
package (Ubuntu)?You can connect to the docker database container and run it there without installing anything else.
amazing
Do you know the command @bo0tzz , I'm not great at the psql command line
Well that's weird

You need to pass the user you set
psql -U foo
ah, i see the flags now
Then
\c immich
(or whatever database name you used)
Then select * from users
should list the users table
Copy the UUID of your user, then update users set "firstName"='foo', "lastName"='bar' where "id"='<uuid>'
(hope I got that sql right 👀 )i grab the UUID from Keycloak right?
No, from the select command
uhm. It didn't skow anyhting
select * from users
had no output?not the first time. I'm going to try second time
Oops, probably forgot the semicolon
select * from users;
yup, now it has output
The update will also need a semicolon that I didn't put
done

welllll......i think the bug is somewhere esle

or maybe i entered wrong ID because in portainer UI the the commandline is pretty bugged as you can see
ah, those semicolons
hooray! It worked
🎉
Should i add the steps to fix it on Github issue as well?
(if someone run into same issue)
Can't hurt, though it's a bit of a corner case and shouldn't be too hard to fix soon
Up to you :)
alright. I will add it as additional info. Btw, as i were deploying the immich, the admin user were created automatically. But i would like to apply OAuth to it as well as the admin account would be my main account on Immich. Is there a way how to "copy" the user to Keycloak so i can use OAuth for it as well?
If you have a user in keycloak with the same email as the admin user, and then log in with that, I think it should link them. Or I believe in the account management settings in immich there should be an oauth link option as well
i'm going to try!
PS: clearing cookies / cache fixed the issue not being able to display the login screen.
Yup, it seems like it linked those two accounts.
Just last question. What is better way to run Immich. Detach admin account off your accout that you'll be using for photos upload and usage or keep them as one account?
I have them as one
in edge case, i can always access the database like i did now and add the storage label "admin" so i will have admin rights?
Yeah
epic! Love Immich
and i'm really grateful to you guys that makes Immich better and better every day. One big thank you. I will tip as soon as my family joins the Immich!
For now, i'm closing this topic.
This is a bug i would say btw
There's a gh issue for it now
GitHub
[BUG] First and Last name must be set on setup with OAuth · Issue #...
The bug Hello. So i've set up immich on docker with additional custom proxy on top of immich's proxy and with OAuth service (Keycloak). I made a user in Keycloak but didn't specify the ...
Ty