Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Commit

Permalink
fix(totp): add sumo link for totp (#6159), r=@shane-tomlinson
Browse files Browse the repository at this point in the history
  • Loading branch information
vbudhram committed May 3, 2018
1 parent 87a2b13 commit d721e0f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Expand Up @@ -20,7 +20,7 @@

<div class="settings-unit-details">
<p>
{{#t}}Add a layer of security to your account by requiring security codes from one of these authentication apps.{{/t}}
{{#unsafeTranslate}}Add a layer of security to your account by requiring security codes from one of <a %(totpSupportAttributes)s>these authentication apps.</a>{{/unsafeTranslate}}
</p>

<div class="totp-list">
Expand Down
4 changes: 3 additions & 1 deletion app/scripts/views/settings/two_step_authentication.js
Expand Up @@ -22,6 +22,7 @@ var t = BaseView.t;
const CODE_INPUT_SELECTOR = 'input.totp-code';
const CODE_REFRESH_SELECTOR = 'button.settings-button.totp-refresh';
const CODE_REFRESH_DELAY_MS = 350;
const TOTP_SUPPORT_URL = 'https://support.mozilla.org/en-US/kb/secure-firefox-account-two-step-authentication';

const View = FormView.extend({
template: Template,
Expand Down Expand Up @@ -112,7 +113,8 @@ const View = FormView.extend({
context.set({
hasToken: this._hasToken,
isPanelOpen: this.isPanelOpen(),
statusVisible: this._statusVisible
statusVisible: this._statusVisible,
totpSupportAttributes: 'class="totp-support-link" target="_blank" href="' + TOTP_SUPPORT_URL + '"'
});
},

Expand Down
6 changes: 6 additions & 0 deletions app/tests/spec/views/settings/two_step_authentication.js
Expand Up @@ -103,6 +103,12 @@ describe('views/settings/two_step_authentication', () => {
return initView();
});

it('should show support link', () => {
assert.equal(view.$('.totp-support-link').length, 1);
assert.equal(view.$('.totp-support-link').attr('href'), 'https://support.mozilla.org/en-US/kb/secure-' +
'firefox-account-two-step-authentication');
});

describe('should show panel when broker capability `showTwoStepAuthentication` is true', () => {
beforeEach(() => {
view.broker.setCapability('showTwoStepAuthentication', true);
Expand Down

0 comments on commit d721e0f

Please sign in to comment.