diff --git a/app/javascript/packages/device/index.js b/app/javascript/packages/device/index.js index dbb610cab71..1d2d2f0d48c 100644 --- a/app/javascript/packages/device/index.js +++ b/app/javascript/packages/device/index.js @@ -17,6 +17,18 @@ export function hasMediaAccess() { return 'mediaDevices' in window.navigator; } +/** + * Returns a boolean promise of whether or not the device has a video input device. + * + * @return {Promise} + */ +export async function hasCamera() { + if (hasMediaAccess()) { + const devices = await navigator.mediaDevices.enumerateDevices(); + return devices.some((device) => device.kind === 'videoinput'); + } +} + /** * Returns true if the current device is assumed to be a mobile device where a camera is available, * or false otherwise. This is a rough approximation, using device user agent sniffing and diff --git a/app/javascript/packs/upload-step.js b/app/javascript/packs/upload-step.js new file mode 100644 index 00000000000..ded77b72ba9 --- /dev/null +++ b/app/javascript/packs/upload-step.js @@ -0,0 +1,10 @@ +// app/packs/upload-step.js +import { hasCamera } from '@18f/identity-device'; + +(async () => { + if (await hasCamera()) { + document.getElementById('upload-comp-liveness').classList.add('hidden'); + document.getElementById('upload-comp-liveness-off').classList.remove('hidden'); + document.getElementById('recommended-tag').classList.remove('hidden'); + } +})(); diff --git a/app/views/idv/doc_auth/upload.html.erb b/app/views/idv/doc_auth/upload.html.erb index 579853fbe04..9347bca0948 100644 --- a/app/views/idv/doc_auth/upload.html.erb +++ b/app/views/idv/doc_auth/upload.html.erb @@ -12,21 +12,18 @@

<%= t('doc_auth.info.upload_liveness_enabled') %>

-

- <%= t('doc_auth.info.upload_no_image_storage') %> -

<% else %>

<%= t('doc_auth.info.upload') %>

<% end %> -
- <%= link_to t('idv.messages.jurisdiction.no_id'), idv_jurisdiction_errors_no_id_path %> -
+

+ <%= t('doc_auth.info.upload_no_image_storage') %> +

<% if Figaro.env.cac_proofing_enabled == 'true' && desktop_device? %> -
+
<%= t( 'doc_auth.info.use_cac_html', link: link_to( @@ -37,6 +34,10 @@
<% end %> +
+ <%= link_to t('idv.messages.jurisdiction.no_id'), idv_jurisdiction_errors_no_id_path %> +
+
@@ -47,7 +48,8 @@ width: 80, ) %>
-
+
@@ -76,7 +78,8 @@
-
+
'> <%= t('doc_auth.info.upload_from_computer') %>  <%= simple_form_for( :doc_auth, @@ -89,7 +92,13 @@ <% end %>
+
'> + <%= t('doc_auth.info.upload_from_computer') %> + <%= t('doc_auth.info.upload_from_computer_not_allowed') %> +
<%= render 'idv/doc_auth/start_over_or_cancel' %> <%= javascript_pack_tag 'image-preview' %> +<%= javascript_pack_tag 'upload-step' %> diff --git a/config/locales/doc_auth/en.yml b/config/locales/doc_auth/en.yml index f202ecd01a3..eba0482fcb3 100644 --- a/config/locales/doc_auth/en.yml +++ b/config/locales/doc_auth/en.yml @@ -75,9 +75,10 @@ en: take_picture: Use the camera on your mobile phone and upload images of your ID. We only use the images to verify your identity. upload: We'll collect information about you by reading your state-issued ID. - We do not store images you upload. We only verify your identity. upload_computer_link: Upload from your computer upload_from_computer: Don't have a phone? + upload_from_computer_not_allowed: Sign in to your login.gov account on any device + that has a camera, like a tablet or computer with a webcam. upload_from_phone: Upload pictures directly from your phone camera upload_image: We only use your ID to verify your identity, and we will not save any images. We accept BMP, PNG, TIFF, and JPG formats. @@ -86,8 +87,8 @@ en: are the owner of the ID. upload_no_image_storage: We do not store images you upload. We only verify your identity. - use_cac_html: "Are you DoD or military? %{link}" - use_cac_link: Use your CAC card instead + use_cac_html: Do you have a government employee ID? %{link} + use_cac_link: Use a PIV/CAC instead welcome: We verify your identity to make sure you are you—not someone pretending to be you. Verifying your identity lets you access services that handle sensitive information. diff --git a/config/locales/doc_auth/es.yml b/config/locales/doc_auth/es.yml index aa65b640599..5d401129320 100644 --- a/config/locales/doc_auth/es.yml +++ b/config/locales/doc_auth/es.yml @@ -81,6 +81,9 @@ es: por el estado. No almacenamos imágenes que cargue. Solo verificamos su identidad. upload_computer_link: Sube desde tu computadora upload_from_computer: "¿No tienes teléfono?" + upload_from_computer_not_allowed: Inicie sesión en su cuenta login.gov en cualquier + dispositivo que tenga una cámara, como una tableta o computadora con una cámara + web. upload_from_phone: Sube imágenes directamente desde la cámara de tu teléfono upload_image: Solo utilizamos su ID para verificar su identidad y no guardaremos ninguna imagen. Aceptamos los formatos BMP, PNG, TIFF y JPG. @@ -89,8 +92,8 @@ es: propietario de la identificación. upload_no_image_storage: No almacenamos imágenes que cargue. Solo verificamos su identidad. - use_cac_html: "¿Eres DoD o militar? %{link}" - use_cac_link: Use su tarjeta CAC en su lugar + use_cac_html: "¿Tiene una identificación de empleado del gobierno? %{link}" + use_cac_link: Usa un PIV/CAC en su lugar welcome: Verificamos su identidad para asegurarnos de que usted es usted, y no alguien que pretende ser usted. Verificar su identidad le permite acceder a servicios que manejan información confidencial. diff --git a/config/locales/doc_auth/fr.yml b/config/locales/doc_auth/fr.yml index b1c594e7ffe..4b69557e3b6 100644 --- a/config/locales/doc_auth/fr.yml +++ b/config/locales/doc_auth/fr.yml @@ -87,6 +87,9 @@ fr: Nous vérifions uniquement votre identité. upload_computer_link: Téléchargez depuis votre ordinateur upload_from_computer: Vous n'avez pas de téléphone? + upload_from_computer_not_allowed: Connectez-vous à votre compte login.gov sur + n'importe quel appareil équipé d'une caméra, comme une tablette ou un ordinateur + avec une webcam. upload_from_phone: Téléchargez des images directement depuis l'appareil photo de votre téléphone upload_image: Nous n'utilisons votre identifiant que pour vérifier votre identité, @@ -97,8 +100,8 @@ fr: une photo de vous pour confirmer que vous êtes le propriétaire de la pièce d'identité. upload_no_image_storage: Nous ne stockons pas les images que vous téléchargez. - use_cac_html: "Êtes-vous DoD ou militaire? %{link}" - use_cac_link: Utilisez plutôt votre carte CAC + use_cac_html: Avez-vous un identifiant d'employé du gouvernement? %{link} + use_cac_link: Utilisez plutôt un PIV/CAC welcome: Nous vérifions votre identité pour nous assurer que vous êtes bien, et non quelqu'un prétendant être vous. La vérification de votre identité vous permet d'accéder à des services traitant des informations sensibles.