Skip to content

Conversation

@pravingv
Copy link
Contributor

What github.com/wevote/weconnect/issues does this fix?

(WV-2292) WeConnect: Add reset WeVote email address to Profile > Edit Info drawer
Added a button "Reset WeVote email address under the “Email Address, WeVote Official” input box.
Incorporated calling “Reset Google User Password“ API from “Admin Functions” section with password generated with generatedrandomstring function.

Changes included this pull request?

src/js/components/Person/EditPersonForm.jsx

Notes:

In weconnect-server, there are currently two API paths related to resetting a user’s password, both inside googleApiController.js:

  1. resetUserPassword(adminClient, primaryEmail, newPassword)
    2. exports.googleResetUserPassword = async (request, response),{ const { primaryEmail, newPassword } = request.body;}

In both cases, newPassword is always passed in from the client, even though a generateRandomString utility exists on the server. This server-side generator is not being used to create the password.

Proposed Solution:

If password generation should occur on the server instead of the client:

  • We can create a new API endpoint dedicated to generating and setting a random password; or
  • We can enhance one of the existing functions (resetUserPassword or googleResetUserPassword) so that it generates the random password internally instead of relying on the client-provided newPassword.
    Either option centralizes password creation on the backend, removes dependence on the client, and ensures stronger control and consistency in password generation.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant