C
Coder.com•3y ago
Atif

Can we rename a user?

I have created a user nut made a typo. How can I rename that user?
23 Replies
Cian
Cian•3y ago
Where did you make the typo? User email? I don't believe there is currently any supported way to rename a user.
Atif
Atif•3y ago
username email is corrrect I can not create a new user wit the same email.
Cian
Cian•3y ago
Yeah, the problem with username is that we name workspace resources with the username 😦
Atif
Atif•3y ago
anyway to chnage email? I can change the email and then create a new one with the current email
Cian
Cian•3y ago
I don't think there's any way to change the email right now besides updating the database directly. Actually, can you log in as the user and click on their username icon on the top right? Then select Account -> there should be a Username field that is editable you can also do via CLI:
curl "https://my.coder.instance/api/v2/users/<user_id>/profile" --data-raw '{"username": "new_username"}' -H "Cookie: session_token=$(cat ~/.config/coderv2/token)"
curl "https://my.coder.instance/api/v2/users/<user_id>/profile" --data-raw '{"username": "new_username"}' -H "Cookie: session_token=$(cat ~/.config/coderv2/token)"
user_id is the UUID of the user
Atif
Atif•3y ago
I will try that
Cian
Cian•3y ago
There is also a trick with email addresses where you add a +identifier e.g. [email protected] -- that will map to the same email address. I use it a lot when signing up for different websites so that I know who is selling my email address 🙂 So you could create another user account with a +identifier and that would still be the same underlying email.
Cian
Cian•3y ago
GitHub
No way to update a user email · Issue #3642 · coder/coder
Problem: Given: a Coder admin creates a user manually with an incorrect email, or needs to update the email address of an existing user When: the admin attempts to update the user email Then: it is...
Atif
Atif•3y ago
it is editbale but it says resource not found in red. It does not let me save the new name
Cian
Cian•3y ago
OK, is your user an administrator?
Atif
Atif•3y ago
no the user I want to chnage is not an admin
Cian
Cian•3y ago
then you're probably hitting this other issue https://github.com/coder/coder/issues/3286
GitHub
Member user cannot update their username · Issue #3286 · coder/coder
Problem statement When a member user tries to update their username, they are thrown an error as seen in the following screenshot: Proposal Either we should allow members to update their own userna...
Atif
Atif•3y ago
My user is an owner aftre 0.8.6 update
Cian
Cian•3y ago
owner == admin Try and see if the CLI method works with your own user, it should have access
Atif
Atif•3y ago
what is user_id n CLI?
Cian
Cian•3y ago
It's the UUID. If you hit https://my.coder.instance/api/v2/users you should see a list of all the users you can then figure out the UUID of the user you want to change.
Atif
Atif•3y ago
somehow CLI was not accepting the token as ~/.config/coderv2/ does not have any file named token
Cian
Cian•3y ago
Are you on Windows?
Atif
Atif•3y ago
I chnaged the role of the user to useradmin then renamed the username and then changed back the role again. It worked
Cian
Cian•3y ago
That's a better workaround 🙂
Atif
Atif•3y ago
No. I am on Ubuntu The codercod bot seems down Thank you @Cian for your time and support.
Cian
Cian•3y ago
The codercod bot seems down
? Ah, @Codercord
Phorcys
Phorcys•3y ago
oh, that's weird
Want results from more Discord servers?
Add your server