RocketChat / RocketChat/Rocket.Chat

feat: Auto-format Authentication Code with Hyphen

Open
#35,178 3 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

In the email, we receive a two-factor authentication code, such as 123-456.

Currently, users can enter the authentication code either as 123456 or 123-456 in the UI, and both formats are accepted. This can cause confusion, as users may not always know whether they should manually input the hyphen.

Expected Behavior:
We would like to implement a feature in the input field where, when the user enters the first three digits (e.g., 123), a hyphen (-) is automatically added after the third digit. This will make the input field more intuitive and eliminate the need for users to manually enter the hyphen.

Proposed Solution:
UI Behavior:

  1. As the user types the authentication code, once the input reaches 3 digits, a hyphen (-) should be automatically appended, making it appear as 123-.
  2. After the hyphen is added, the user can continue entering the remaining digits (e.g., 456), and the hyphen will remain in place.
  3. The final format should be 123-456, and the hyphen should not interfere with the user experience.

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 file, entry point, or test is named in the issue. Locate the authentication-code input in the TypeScript UI and inspect its existing handling for both six digits and the 123-456 form; done means typing the first three digits inserts a hyphen, the remaining digits can be entered normally, and the final value is accepted.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authentication, frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.