From 123003fdc5889098333398965df87072ff4782b0 Mon Sep 17 00:00:00 2001 From: Vijay Budhram Date: Tue, 20 Aug 2024 21:20:17 -0400 Subject: [PATCH] feat(glean): Fix email on "Sign in" link when pairing fails --- .../app/scripts/templates/pair/failure.mustache | 2 +- .../fxa-content-server/app/scripts/views/pair/failure.js | 6 ++++++ packages/fxa-shared/metrics/glean/web/event.ts | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/fxa-content-server/app/scripts/templates/pair/failure.mustache b/packages/fxa-content-server/app/scripts/templates/pair/failure.mustache index bd9d16b08c..43d27c7eb9 100644 --- a/packages/fxa-content-server/app/scripts/templates/pair/failure.mustache +++ b/packages/fxa-content-server/app/scripts/templates/pair/failure.mustache @@ -16,7 +16,7 @@ {{#showSigninLink}}
- +
{{/showSigninLink}} diff --git a/packages/fxa-content-server/app/scripts/views/pair/failure.js b/packages/fxa-content-server/app/scripts/views/pair/failure.js index c276d420b5..b02554ce15 100644 --- a/packages/fxa-content-server/app/scripts/views/pair/failure.js +++ b/packages/fxa-content-server/app/scripts/views/pair/failure.js @@ -23,6 +23,12 @@ class PairFailureView extends FormView { clickSignin() { const params = this.model.get('searchParams'); + + // We replace the `email` with `prefillEmail` so that the email + // first page gets populated correctly. + const email = params.get('email'); + params.delete('email'); + params.set('prefillEmail', email); window.location.href = `${window.location.origin}${params}`; } } diff --git a/packages/fxa-shared/metrics/glean/web/event.ts b/packages/fxa-shared/metrics/glean/web/event.ts index e0bbcb809d..d64614dc8c 100644 --- a/packages/fxa-shared/metrics/glean/web/event.ts +++ b/packages/fxa-shared/metrics/glean/web/event.ts @@ -4,8 +4,8 @@ // AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT. -import StringMetricType from '@mozilla/glean/private/metrics/string'; import BooleanMetricType from '@mozilla/glean/private/metrics/boolean'; +import StringMetricType from '@mozilla/glean/private/metrics/string'; /** * The name of the event