Page MenuHomePhabricator

[lib][native][web] add new changeIdentityUserPassword action
ClosedPublic

Authored by varun on Jan 11 2024, 12:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Sep 9, 9:02 AM
Unknown Object (File)
Sat, Aug 31, 10:44 PM
Unknown Object (File)
Thu, Aug 29, 5:53 PM
Unknown Object (File)
Aug 1 2024, 6:19 AM
Unknown Object (File)
Aug 1 2024, 6:19 AM
Unknown Object (File)
Aug 1 2024, 6:19 AM
Unknown Object (File)
Aug 1 2024, 6:19 AM
Unknown Object (File)
Aug 1 2024, 6:19 AM
Subscribers

Details

Summary

users should be able to change their passwords on the identity service. this diff introduces the action that will be dispatched from native and web. it also includes the changes to the grpc-web client.

Test Plan

successfully dispatched the new action from native and web. then successfully logged in to identity with the new password.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

varun published this revision for review.Jan 11 2024, 12:52 PM

Requesting review to get help resolving the issue described in the inline comment

web/grpc/identity-service-client-wrapper.js
107 ↗(On Diff #35563)

this is giving me a flow error because the Error constructor only expects one argument. I'm trying to follow this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Error#rethrowing_an_error_with_a_cause

web/grpc/identity-service-client-wrapper.js
79–81 ↗(On Diff #35563)

i'm not sure why, but flow didn't like this, so i had to declare a new variable client in changePassword

JS looks great!! Didn't review the specifics of the OPAQUE stuff but trust you have that covered

This revision is now accepted and ready to land.Jan 11 2024, 8:03 PM
native/identity-service/identity-service-context-provider.react.js
67 ↗(On Diff #35567)

This await doesn't change the logic:

  1. If it is present, the promise is resolved to a value, which is then automatically wrapped in a promise by the async function
  2. If it isn't present, the promise is directly returned, without unwrapping and wrapping

So it might be unnoticeably more efficient to not have the await. But I guess it might cause some confusion, so up to you. (I think eslint should warn us about a promise that is left without being awaited or returned, but I might be wrong)

native/identity-service/identity-service-context-provider.react.js
67 ↗(On Diff #35567)

Thanks for explaining this... didn't realize that's how it worked. @varun can probably leave the logic as-is and undo these changes. Personally I think either way is fine, but if perf is better in your variant then that's probably best

I think eslint should warn us about a promise that is left without being awaited or returned, but I might be wrong

It's actually Flow that will warn us about that

ashoat requested changes to this revision.Jan 13 2024, 6:48 PM
ashoat added inline comments.
lib/actions/user-actions.js
508 ↗(On Diff #35567)

The latest release of the whitepaper (viewable on Overleaf or GitHub) defines a protocol for password updates in Section 3.2.1.4. As part of that protocol, the user's current password is supposed to be verified. The whitepaper update happened earlier this month... sorry for not noticing earlier.

I think this will require some identity service changes, and the client will need to make at least two gRPC calls...

This revision now requires changes to proceed.Jan 13 2024, 6:48 PM

update to match whitepaper

native/identity-service/identity-service-context-provider.react.js
708 ↗(On Diff #41456)

i'll remove this await

add the action types to redux-types.js

This revision is now accepted and ready to land.Jun 18 2024, 10:09 AM