Skip to content

feat: 2fa backup codes#3

Open
everettbu wants to merge 1 commit into
enhance-two-factor-security-foundationfrom
improve-two-factor-authentication-features
Open

feat: 2fa backup codes#3
everettbu wants to merge 1 commit into
enhance-two-factor-security-foundationfrom
improve-two-factor-authentication-features

Conversation

@everettbu

@everettbu everettbu commented Jul 28, 2025

Copy link
Copy Markdown

Test 3

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

@lizard-boy

Copy link
Copy Markdown

cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bugbot free trial expires on August 11, 2025
Learn more in the Cursor dashboard.

import { useLocale } from "@calcom/lib/hooks/useLocale";
import { Label, TextField } from "@calcom/ui";

export default function TwoFactor({ center = true }) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Incorrect Default Function Name

The default exported function in apps/web/components/auth/BackupCode.tsx is incorrectly named TwoFactor. It should be BackupCode to match the file name and the component's purpose of handling backup codes. This copy-paste error causes confusion and inconsistency.

Locations (1)
Fix in Cursor Fix in Web

const backupCodes = JSON.parse(symmetricDecrypt(user.backupCodes, process.env.CALENDSO_ENCRYPTION_KEY));

// check if user-supplied code matches one
const index = backupCodes.indexOf(req.body.backupCode.replaceAll("-", ""));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Case-Sensitive Backup Code Validation

Backup code validation is case-sensitive due to the use of indexOf(). This causes validation to fail if a user enters uppercase hex characters, as backup codes should be case-insensitive for a better user experience. The comparison should convert both the stored codes and user input to lowercase.

Locations (2)
Fix in Cursor Fix in Web

@github-actions

Copy link
Copy Markdown
Contributor

This PR is being marked as stale due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants