Page MenuHomePhabricator

[lib] add reserved username workflow to identity login actions
ClosedPublic

Authored by varun on May 6 2024, 7:33 AM.
Tags
None
Referenced Files
F3350498: D11912.diff
Fri, Nov 22, 10:51 PM
Unknown Object (File)
Thu, Nov 14, 5:49 AM
Unknown Object (File)
Wed, Nov 13, 8:44 PM
Unknown Object (File)
Tue, Nov 12, 12:00 PM
Unknown Object (File)
Tue, Nov 12, 9:23 AM
Unknown Object (File)
Tue, Nov 12, 7:43 AM
Unknown Object (File)
Tue, Nov 12, 6:24 AM
Unknown Object (File)
Tue, Nov 12, 5:49 AM
Subscribers
None

Details

Summary

in our identity login actions, we should check the exception message and if it tells us that the username is reserved, we should attempt reserved registration (if possible, i.e. if on native)

Depends on D11911

Test Plan

on staging, i set the keyserver public key env var to my local keyserver's device ID. then i registered a user directly with my keyserver. flipped usingCSAT to true and tried logging in again. confirmed that i was registered with the identity service and granted an access token

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

lib/actions/user-actions.js
661–673 ↗(On Diff #39858)

not sure why, but flow wasn't able to see that identityClient.registerReservedPasswordUser is not undefined inside this condition, so i used the registerReservedPasswordUser function, which calls identityClient.registerReservedPasswordUser. would like to avoid this indirection if there's a better way to resolve the flow issue

varun published this revision for review.May 6 2024, 7:49 AM
varun planned changes to this revision.

Improve test plan

lib/actions/user-actions.js
661–673 ↗(On Diff #39858)

I think you can avoid it if you extract registerReservedPasswordUser to a local varible before checking it

varun edited the summary of this revision. (Show Details)
ashoat added inline comments.
lib/actions/user-actions.js
636–637 ↗(On Diff #40813)

Shorthand

636–655 ↗(On Diff #40813)
This revision is now accepted and ready to land.Jun 1 2024, 12:02 PM