RocketChat / RocketChat/Rocket.Chat

Oauth username is preventing to change avatar

Open
#31,137 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: bug
Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

Using Oauth as described in https://github.com/RocketChat/Rocket.Chat/issues/30520#issuecomment-1743483801, it's possible to create username based on email addresses containing a second @, e.g. @username@example.com.

This works fine overall, but some functions like changing the avatar are blocked because "the username is invalid"

Steps to reproduce:

1 - Create user username@example.com, for example using Oauth configured as described in https://github.com/RocketChat/Rocket.Chat/issues/30520#issuecomment-1743483801
2 - Log in with newly-created account, try to change the avatar
3 - Log in with admin account, try to change the user's avatar

Expected behavior:
  • User can change his own avatar
  • Admin can change the user's avatar
Actual behavior:
  • Rocketchat refuses the change, throws "Invalid username" error, unless the username is change to remove the @
Server Setup Information:
  • Version of Rocket.Chat Server: 6.3.7
  • Operating System: Debian 11
  • Deployment Method: tar
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version: 14.21.3
  • MongoDB Version: 5.0.18
Client Setup Information
  • Desktop App or Browser Version: Any (server-side error)
  • Operating System: Any (server-side error)
Additional context
Relevant logs:

Capture d’écran du 2023-11-14 09-52-47

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is identified in the issue. Reproduce the avatar change with an OAuth-created username containing a second @, then trace the server-side validation that rejects the request as an invalid username. Done means both the user and an administrator can change the avatar without removing the @ from the username.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.