RocketChat / RocketChat/Rocket.Chat

User authenticated using OAuth not added to default rooms due to default avatar issue

Open
#25,406 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description:

A new user that perform authentication using OAuth (GitHub, Google, etc.) is not added to rooms configured as "default". A user that register with username and password is added, as expected, to the "default" rooms.

Steps to reproduce:
  1. Configure at least one OAuth provider (e.g. GitHub)
  2. Create several rooms
  3. Add the "default" setting to more than one room
  4. Register and login with using OAuth → user is not added to any room but can join them manually
  5. Register with email and password → user is added to all default room
Expected behavior:

A new user should be added to all default room not matter the authentication mechanism used.

Actual behavior:

User not added to default room when using OAuth.

Server Setup Information:
  • Version of Rocket.Chat Server: 4.6.3 and also reproduce on 4.7.0
  • Operating System: Debian GNU/Linux 10 (buster) on the server
  • Deployment Method: Docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: enabled
  • NodeJS Version: v14.18.3
  • MongoDB Version: 4.4.13 / wiredTiger (oplog Enabled)
Client Setup Information
  • Desktop App or Browser Version: Firefox 91.8.0esr (64 bits)
  • Operating System: Debian GNU/Linux 11 (bullseye)
Relevant logs:

{"level":50,"time":"2022-05-09T12:49:50.313Z","pid":37,"hostname":"01a08d797a59","name":"System","msg":"Exception while invoking method setUsername 'Cannot read property 'blob' of undefined'"}

This log is due to code call but I don't know the exact root cause.

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

Start with apps/meteor/app/lib/server/functions/setUsername.ts at the referenced line and compare the OAuth and username/password registration paths. Reproduce the default-room setup described in the issue while checking the reported 'blob' error. Done means newly registered OAuth users are added to every room marked default, as password-registered users are.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authentication, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.