agenta icon indicating copy to clipboard operation
agenta copied to clipboard

[AGE-2166] Add Reset Password Functionality to Workspace UI

Open mmabrouk opened this issue 9 months ago • 1 comments

Overview

We want to add the reset password functionality in the UI under workspace settings. This will allow any user to reset passwords for users in their workspace.

Background

The backend API for password reset is already implemented and available in OSS . In the OSS version, any authenticated user can reset another user's password.

UI Implementation

CleanShot 2025-04-10 at 12.17.52@2x.png

  1. Add a "Reset Password" element in the pannel (see screenshot) next to each user in the table
  2. When clicked, display a confirmation dialog explaining that this will create a password reset link
  3. Upon confirmation, call the reset password API endpoint
  4. Show appropriate the password reset linkafter the API cal

Technical Details

API Endpoint

  • Endpoint: POST /reset-password
  • Parameters:
    • user_id: The ID of the user whose password will be reset
  • Authentication: Requires authentication token in the request header
  • Response: Returns the reset password link ( or a success message

From SyncLinear.com | AGE-2166

mmabrouk avatar Apr 10 '25 10:04 mmabrouk

Hi @mmabrouk ,

I'd like to work on this issue. I've analyzed the codebase extensively and discovered that most of the UI components are already implemented but not integrated. Here's my implementation strategy:

Current Status Analysis

  • GenerateResetLinkModal and PasswordResetLinkModal components exist
  • ✅ Type definitions are already in place
  • ❌ API service function needs to be added
  • ❌ Reset button needs integration in the Actions dropdown
  • ❌ Modal integration with WorkspaceManage component

Implementation Approach

1. API Integration (web/oss/src/services/workspace/api/index.ts)

export const resetUserPassword = async ({
    orgId,
    workspaceId,
    userId,
}: {
    orgId: string
    workspaceId: string
    userId: string
}): Promise<{reset_link: string}> => {
    const {data} = await axios.post(`/reset-password`, {
        user_id: userId,
    })
    return data
}
  1. UI Integration (web/oss/src/components/pages/settings/WorkspaceManage/cellRenderers.tsx)

Add reset password option to the Actions dropdown for active members only Integrate existing modals with proper state management Follow existing patterns for loading states and error handling

  1. Testing

Add Playwright E2E tests covering the reset password workflow

Questions:

Should the reset password option be available for all member roles, or only specific ones? Any specific error handling requirements beyond the existing patterns?

I can have this implemented within 24-48 hours following the established codebase patterns. Would you like me to proceed?

Nel4Nelson avatar Sep 13 '25 16:09 Nel4Nelson