LG-8577: Prefill user's mobile number for hybrid docauth#7762
Conversation
If the user has a mobile number associated with their account, prefill that when showing the handoff screen for hybrid docauth. changelog: User-Facing Improvements, Identity Verification, Prefill mobile number for hybrid doc auth
| def extra_view_variables | ||
| { | ||
| idv_phone_form: create_form, | ||
| } | ||
| end |
There was a problem hiding this comment.
This feels kind of yucky, but I think is the way to do this until we pull the hybrid flow out of the FSM?
There was a problem hiding this comment.
Yeah, I think if we were invested in improving FSM, it could be nice to somehow provide a form object through the FSM machinery, but it seems like we're moving away from that, and this is the otherwise standard way to make values available to the view, so seems fine to me.
|
In testing, I noticed that this didn't prefill anything for me when I have two phones configured to my account. Is that expected? |
aduth
left a comment
There was a problem hiding this comment.
I love using the form object this way! I've been wishing we'd do more of this.
| def extra_view_variables | ||
| { | ||
| idv_phone_form: create_form, | ||
| } | ||
| end |
There was a problem hiding this comment.
Yeah, I think if we were invested in improving FSM, it could be nice to somehow provide a form object through the FSM machinery, but it seems like we're moving away from that, and this is the otherwise standard way to make values available to the view, so seems fine to me.
| { | ||
| idv_phone_form: be_an_instance_of(Idv::PhoneForm), | ||
| }, |
There was a problem hiding this comment.
Technically the curly braces could be optional, though I don't have a strong preference in case you think they help readability.
| { | |
| idv_phone_form: be_an_instance_of(Idv::PhoneForm), | |
| }, | |
| idv_phone_form: be_an_instance_of(Idv::PhoneForm), |
Co-authored-by: Andrew Duthie <andrew.duthie@gsa.gov>
| <p><%= t('doc_auth.instructions.send_sms') %></p> | ||
| <%= simple_form_for( | ||
| :doc_auth, | ||
| idv_phone_form, |
There was a problem hiding this comment.
just to check: the only reason we're building the form is so we can pass it something that responds to #phone right? Could we pass a different object or like a simple PORO/Struct that has a #phone method?
There was a problem hiding this comment.
I based this usage on Idv::PhoneController which also uses Idv::PhoneForm. The form has some logic already built into it to pre-fill the user's MFA phone number.
Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>
@aduth Yeah, it looks like this has been this form's behavior for a couple years now. I'm not sure why that would be? |
If the user has a mobile number associated with their account, prefill that when showing the handoff screen for hybrid docauth.
🎫 Ticket
LG-8577
🛠 Summary of changes
If the user has a phone number associated with their account (from 2fa), use that to prefill the phone number field on the doc auth hybrid handoff screen.
📜 Testing Plan
Provide a checklist of steps to confirm the changes.
👀 Screenshots