jac-uk / apply

Vue SPA to allow candidates to apply for judicial vacancies
https://apply.judicialappointments.digital
MIT License
4 stars 0 forks source link

2FA - Replace Phone Number With UK Mobile Phone Number #1242

Open drieJAC opened 1 week ago

drieJAC commented 1 week ago

This ticket is part of the following epic: https://github.com/jac-uk/apply/issues/1220

Background

As part of implementing 2FA we would like to replace the phone number field with one for UK mobile number. However old applications will still have phone numbers associated with them so this field still needs to be supported so that it displays in both admin and apply (a separate ticket needs to be created for this in admin). Also a ticket needs to be created in DP to ensure the mobile number gets validated on the server side as well as the client side.

User Story

As a candidate, I would like UK mobile number field to be implemented in the candidate profile on Apply and also the personal details page in the application. Note that the phone field should not be displayed unless it is already populated in both the profile and the personal details sections. Add a mobileVerifiedAt timestamp to the db too. This will be used further down the line when SMS is sent out to verify the number. We should indicate that the number is verified/unverified with a nice icon or some text next to the value/form field. When it is displayed in the profile page we should add a button next to the value to resend the verification (if the value is unverified). In the application we can add some text to tell the user that if they need to verify the number they should go to the Profile page (similar to the message for NIN and DoB).

The new fields in the db will be at: applications/{id}}personalDetails/mobile (string) candidate/documents/personalDetails/mobile (string) candidate/documents/personalDetails/mobileVerifiedAt (timestamp)

The mobile phone field should be validated as a UK mobile phone number.

See: https://design-system.service.gov.uk/patterns/phone-numbers/ https://github.com/jackocnr/intl-tel-input/tree/master/vue

Benefit(s) to user (if not already clear from User story)

The mobile phone number will be used as part of 2FA and the number will be verified so we know it belongs to the owner

Feature(s) Description

HalcyonJAC commented 3 days ago

UPDATE: