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

Commit

Permalink
fix(oauth): fixes WebChannel double submit during password reset
Browse files Browse the repository at this point in the history
  • Loading branch information
vladikoff committed Oct 29, 2014
1 parent e90da6d commit c4ad628
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/scripts/views/ready.js
Expand Up @@ -61,7 +61,7 @@ function (_, BaseView, Template, Session, Xss, Strings,
var graphic = this.$el.find('.graphic');
graphic.addClass('pulse');
// Finish the WebChannel flow
if (this.relier.get('webChannelId')) {
if (this.isOAuthSameBrowser() && this.relier.get('webChannelId')) {
this.submit();
}

Expand Down
9 changes: 9 additions & 0 deletions tests/functional/oauth_webchannel.js
Expand Up @@ -25,6 +25,7 @@ define([
var user;
var email;
var client;
var ANIMATION_DELAY_MS = 1000;
/* global window, addEventListener */

/**
Expand Down Expand Up @@ -335,6 +336,14 @@ define([
.findByCssSelector('#fxa-reset-password-complete-header')
.end()

.sleep(ANIMATION_DELAY_MS)

.findByCssSelector('.error').isDisplayed()
.then(function (isDisplayed) {
assert.isFalse(isDisplayed);
})
.end()

.closeCurrentWindow()
// switch to the original window
.switchToWindow('')
Expand Down

0 comments on commit c4ad628

Please sign in to comment.