Skip to content

Commit

Permalink
Merge pull request #2256 from mozilla/add-prompt-none-to-relay-link
Browse files Browse the repository at this point in the history
Add prompt none to relay link
  • Loading branch information
groovecoder authored Aug 20, 2021
2 parents 8df7af2 + f2bdd32 commit eb1e19a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions public/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,13 @@ if (removeMonitorButton) {
await sendForm(formAction, {_csrf: csrfToken, primaryToken, primaryHash});
});
}

const relayLink = document.querySelector("[data-event-label='Try Firefox Relay']");
const user_email = document.querySelector(".nav-user-email").textContent;
if (user_email) {
const relayUrl = new URL(relayLink.href);
relayUrl.pathname += "accounts/fxa/login/";
relayUrl.searchParams.append("process", "login");
relayUrl.searchParams.append("auth_params", "prompt=none&login_hint=" + user_email);
relayLink.href = relayUrl.href;
}

0 comments on commit eb1e19a

Please sign in to comment.