Skip to content

created a new settings page for the new UI#959

Open
L-Tarun-Aditya wants to merge 10 commits intostagefrom
feat/2-factor-auth-frontend
Open

created a new settings page for the new UI#959
L-Tarun-Aditya wants to merge 10 commits intostagefrom
feat/2-factor-auth-frontend

Conversation

@L-Tarun-Aditya
Copy link
Copy Markdown
Member

@L-Tarun-Aditya L-Tarun-Aditya commented Feb 18, 2026

Description

this pr closes #958

Title

Implement Dedicated Settings Page & 2FA

Description

This PR introduces a dedicated Settings Page to centralize account management and improve security. It migrates existing account features from the Dashboard and adds Two-Factor Authentication (2FA) support.

Key Changes:

  • New Settings Page: Created a dedicated page for user configuration.
  • 2FA Integration: Added components to enable and disable Two-Factor Authentication.
  • Feature Migration: Moved the following from the Dashboard to the Settings page:
    • User Info editing
    • Change Password
    • Download Data
  • Dashboard Cleanup: Removed account management forms from the main Dashboard view.

Why is this needed?

  • Security: Enables 2FA to prevent unauthorized access.
  • UX Best Practices: Separates operational data (Dashboard) from account configuration (Settings).
  • Maintainability: Consolidates user-related logic into a single location.

What type of PR is this? (Check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📄 Documentation Update
  • 👨‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🛠️ CI/CD

Screenshots (if applicable)

image image
mfa.mp4

Checklist

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@L-Tarun-Aditya L-Tarun-Aditya marked this pull request as ready for review February 18, 2026 14:10
@github-actions github-actions bot added the enhancement New feature or request label Feb 18, 2026
@MukeshAbhi MukeshAbhi marked this pull request as draft February 18, 2026 16:01
@L-Tarun-Aditya L-Tarun-Aditya force-pushed the feat/2-factor-auth-frontend branch from 9eaf1bb to 305f129 Compare February 22, 2026 18:28
@L-Tarun-Aditya L-Tarun-Aditya requested review from Smayur0 and anujarora0502 and removed request for MukeshAbhi February 22, 2026 18:30
@L-Tarun-Aditya L-Tarun-Aditya marked this pull request as ready for review February 22, 2026 18:31
@MukeshAbhi MukeshAbhi requested review from sachinkmrsin and removed request for mridul-giri February 24, 2026 14:17
@anshj20 anshj20 linked an issue Mar 2, 2026 that may be closed by this pull request
2 tasks
@L-Tarun-Aditya L-Tarun-Aditya marked this pull request as draft March 8, 2026 00:23
@L-Tarun-Aditya L-Tarun-Aditya force-pushed the feat/2-factor-auth-frontend branch from 65351f3 to d315869 Compare March 15, 2026 13:02
@L-Tarun-Aditya L-Tarun-Aditya marked this pull request as ready for review March 16, 2026 11:04
@L-Tarun-Aditya L-Tarun-Aditya force-pushed the feat/2-factor-auth-frontend branch 2 times, most recently from a0a405a to 3c91ffe Compare March 17, 2026 11:45
@L-Tarun-Aditya L-Tarun-Aditya force-pushed the feat/2-factor-auth-frontend branch from 3c91ffe to ed80ccc Compare March 17, 2026 12:11
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

the tests will be in a different pr

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

the tests will be in a different pr

ALREADY_SEND_RESPOND: "Already sent the response.",
UPDATE_SUCCESS: "Responded successfully.",
INCORRECT_PASSWORD: "Current password is incorrect",
SAME_PASSWORD:"Current password is same as old password",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can use better messages
like

INCORRECT_PASSWORD: "Password is incorrect.",
SAME_PASSWORD: "Passwords must be different."

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this was already there all i did was run pnpm format and add an extra space thats it. and i think "current password is same as the old password" is more helpful than "must be different" as it explains the problem better , same with the INCORRECT_PASSWORD variable

});

const handleSubmit = async () => {
console.log("pin", pin);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove console

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yes sure

Copilot AI review requested due to automatic review settings March 18, 2026 04:20
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors account-related UI by moving profile/security functionality out of the dashboard into a new protected Settings route, and adds MFA flows (2FA setup/disable + MFA sign-in PIN).

Changes:

  • Add /settings route with a new UserSettings page (sidebar tabs) and new ProfileInfo + TwoFactorAuth components.
  • Add MFA sign-in PIN component and update Sign In to branch into MFA when mfaRequired is returned.
  • Update theme/button styling by introducing --white-fixed and adjusting several component CSS modules; remove some dashboard cards and delete Sign In/UserInfo tests.

Reviewed changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
packages/ui/src/utils/Constants.js Reformat dashboard titles; add USER_SETTINGS_TITLE.
packages/ui/src/page/dashboard/Dashboard.jsx Remove Plan/User Info/Password/Setting cards from dashboard.
packages/ui/src/index.css Add --white-fixed theme token.
packages/ui/src/components/usersettings/UserSettings.module.css New Settings page layout/styles.
packages/ui/src/components/usersettings/UserSettings.jsx New Settings page with sidebar tabs.
packages/ui/src/components/userinfo/UserInfo.module.css Adjust spacing + ensure primary button text uses --white-fixed.
packages/ui/src/components/twofactorauth/TwoFactorAuth.module.css New 2FA UI styling.
packages/ui/src/components/twofactorauth/TwoFactorAuth.jsx New 2FA enable/verify/disable flows using /auth/mfa/* endpoints.
packages/ui/src/components/settings/SettingCard.module.css Ensure danger button text uses --white-fixed.
packages/ui/src/components/profileinfo/ProfileInfo.module.css New profile/settings grid card layout styling.
packages/ui/src/components/profileinfo/ProfileInfo.jsx New page composing UserInfo/ChangePassword/Setting/Plan.
packages/ui/src/components/pin/Pin.module.css New MFA PIN input styling.
packages/ui/src/components/pin/Pin.jsx New MFA PIN verification component (/auth/mfa/signin).
packages/ui/src/components/dropdown/UserDropDown.jsx Add Settings link to dropdown.
packages/ui/src/components/currentplan/CurrentPlan.module.css Update spacing and button text color variable.
packages/ui/src/components/currentplan/CurrentPlan.jsx Set Button variant="primary" for upgrade button.
packages/ui/src/components/common/button/Button.module.css Change disabled styling (remove opacity).
packages/ui/src/components/changepassword/ChangePassword.module.css Ensure primary button text uses --white-fixed.
packages/ui/src/components/auth/Signin.jsx Add MFA-required branch and render PIN UI; hide form while in MFA.
packages/ui/src/App.jsx Add protected /settings route.
packages/ui/tests/components/UserInfo.test.jsx Delete tests.
packages/ui/tests/components/auth/Signin.test.jsx Delete tests.
packages/app/utils/constants.js Formatting cleanup of message constants.
Comments suppressed due to low confidence (1)

packages/ui/src/utils/Constants.js:648

  • USER_SETTINGS_TITLE is exported but appears to be unused (no references in packages/ui/src). If it’s not needed, remove it; otherwise, wire it into the settings UI to avoid dead constants drifting out of sync.
export const DASHBOARD_CARDS_TITLE = ["Usage", "Generate New API Key"];
export const USER_SETTINGS_TITLE = [
  "Plan",
  "User Info",
  "Change Password",
  "Setting",
];

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 14 to 18
.button:disabled {
color: var(--white);
cursor: not-allowed;
opacity: 0.8;
pointer-events: none;
}
Comment on lines +51 to +58
const { success, data, error } = await checkMFARequest();
if (success && data?.isMfaEnabled !== undefined) {
setIsMFAEnabled(data.isMfaEnabled);
setMode(data.isMfaEnabled ? "VERIFIED" : "INITIAL");
} else {
setIsMFAEnabled(false);
setMode("INITIAL");
toast.error(error);

export default function TwoFactorAuth() {
const [isMFAEnabled, setIsMFAEnabled] = useState(false);
const [mode, setMode] = useState("VERIFIED"); // INITIAL, SETUP, VERIFIED, DISABLE
Comment on lines +337 to +341
.disableCancleBtn {
position: absolute;
right: 2rem;
bottom: 2rem;
}
Comment on lines +54 to +62
<div className={styles.card}>
<div className={styles.cardBody}>
<div className={styles.initialState}>
<h3 className={styles.heading}>Coming Soon</h3>
<p className={styles.subtext}>
The {menuItems.find((i) => i.id === activeTab)?.label}{" "}
settings are currently under development.
</p>
</div>
setPin(new Array(6).fill(""));
setIsAuthenticated(true);
navigate("/dashboard");
onClose();
Comment on lines 136 to 141
if (success) {
if (data.source && data.statusCode === 201) {
toast.success(MESSAGES.VERIFICATION_EMAIL_SENT);
} else if (data.mfaRequired && data.statusCode === 200) {
setIsMFAEnabled(true);
} else {
)}

{isForgotPassword && (
{isMFAEnabled && <Pin onClose={onClose} />}
Comment on lines +5 to +10
background-color: var(--background-light);
min-height: 100vh;
}

[data-theme="dark"] .container {
background-color: var(--background-dark);
}

[data-theme="dark"] .card {
background-color: var(--background-dark);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0.8.0 Implement Dedicated User Settings Page and Two-Factor Authentication (2FA)

4 participants