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
F3373263: D11912.id40862.diff
Tue, Nov 26, 8:36 AM
F3369095: D11912.id40814.diff
Mon, Nov 25, 9:44 PM
F3368655: D11912.id40855.diff
Mon, Nov 25, 8:33 PM
Unknown Object (File)
Mon, Nov 25, 1:42 PM
Unknown Object (File)
Sun, Nov 24, 7:19 PM
Unknown Object (File)
Sun, Nov 24, 1:05 PM
Unknown Object (File)
Sun, Nov 24, 9:43 AM
Unknown Object (File)
Sat, Nov 23, 8:44 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

Shorthand

636–655
This revision is now accepted and ready to land.Jun 1 2024, 12:02 PM