Page MenuHomePhabricator

[lib] Add preRequestUserState to identity login
ClosedPublic

Authored by inka on Mar 27 2024, 3:55 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 26, 1:23 AM
Unknown Object (File)
Fri, Apr 19, 9:59 PM
Unknown Object (File)
Fri, Apr 19, 9:59 PM
Unknown Object (File)
Fri, Apr 19, 9:58 PM
Unknown Object (File)
Fri, Apr 19, 12:34 AM
Unknown Object (File)
Sat, Apr 13, 2:35 AM
Unknown Object (File)
Tue, Apr 9, 11:44 AM
Unknown Object (File)
Sun, Apr 7, 8:46 PM
Subscribers

Details

Summary

We need to know the preRequestUserState to be able to decide if the login is a recovery login

Test Plan

Checked in the reducer that the value is present

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

inka requested review of this revision.Mar 27 2024, 4:10 AM
varun requested changes to this revision.Mar 27 2024, 9:00 AM
varun added inline comments.
lib/types/identity-service-types.js
159 ↗(On Diff #38352)

should this be optional and non-nullable? confused why flow doesn't complain that the other hooks that return Promise<IdentityAuthResult> like useIdentityPasswordRegister() aren't returning a preRequestUserState key

This revision now requires changes to proceed.Mar 27 2024, 9:00 AM
lib/actions/user-actions.js
547 ↗(On Diff #38352)
lib/types/identity-service-types.js
159 ↗(On Diff #38352)

sorry it should definitely be nullable, but still wondering if it should be optional as well. also still don't understand why flow doesn't complain

lib/types/identity-service-types.js
159 ↗(On Diff #38352)

I've also noticed that Flow gets this wrong sometimes

lib/types/identity-service-types.js
159 ↗(On Diff #38352)

Yes, you are right, it should be both optional and nullable

Make preRequestUserState optional

varun added inline comments.
lib/actions/user-actions.js
547 ↗(On Diff #38439)

think this can be simplified, right?

This revision is now accepted and ready to land.Mar 28 2024, 8:50 AM