RocketChat / RocketChat/Rocket.Chat

chore: Add configurable subject setting for 2FA authentication code email

Open
#39,771 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Problem Statement

The 2FA authentication email subject is hardcoded as 'Authentication code' in 'EmailCheck.ts' instead of reading from a configurable admin setting.
This is inconsistent with other Rocket.Chat emails like Device Management, Forgot Password, and Verification emails which all read their subject from the settings registry.

Current Behavior

In 'apps/meteor/app/2fa/server/code/EmailCheck.ts' -
subject: 'Authentication code' is hardcoded.

Image

Expected Behavior

The subject should read from a configurable setting following the existing pattern used by other Rocket.Chat email templates, with a default value of '[Site_Name] - Authentication Code'.

Steps to Reproduce

  1. Set up 2FA via Email
  2. Trigger a 2FA email
  3. Observe subject shows generic 'Authentication code' instead of '[Site_Name] - Authentication Code'

Proposed Solution

  1. Add 'Accounts_TwoFactorAuthentication_By_Email_Subject' setting in 'createAccountSettings.ts'
  2. Read the setting in 'EmailCheck.ts' via 'settings.get()'
  3. Add translation key in 'en.i18n.json' with default '[Site_Name] - Authentication Code'

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/2fa/server/code/EmailCheck.ts and compare how other email templates read subjects from settings. Add the setting in createAccountSettings.ts and its translation in en.i18n.json, then verify that the 2FA email uses the configured subject and defaults to '[Site_Name] - Authentication Code'.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authentication, backend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.