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

Commit

Permalink
feat(signin): Skip signin confirmation for new accounts by default (#…
Browse files Browse the repository at this point in the history
…1992) r=vladikoff

* feat(signin): Skip signin confirmation for new accounts by default

fixes #1991

* fix(test): Fix the tests broken by the config change.

Disabling signin confirmation caused a lot of test failures.

Tests that called `loginAndVerify` to get a verified
session have been updated to call `login`.

Tests that work with both unverified and verified sessions
are handled differently. So that it's possible to generate
unverified sessions, config in these tests override
signinConfirmation.skipForNewAccounts.enabled to false.
  • Loading branch information
Shane Tomlinson authored and vladikoff committed Jul 13, 2017
1 parent 0217750 commit 9900c42
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ var conf = convict({
skipForNewAccounts: {
enabled: {
doc: 'Skip sign-in confirmation for newly-created accounts.',
default: false,
default: true,
env: 'SIGNIN_CONFIRMATION_SKIP_FOR_NEW_ACCOUNTS'
},
maxAge: {
Expand Down
4 changes: 2 additions & 2 deletions test/remote/account_reset_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe('remote account reset', function() {
.then(
function () {
// make sure we can still login after password reset
return Client.loginAndVerify(config.publicUrl, email, newPassword, server.mailbox, {keys:true})
return Client.login(config.publicUrl, email, newPassword, {keys:true})
}
)
.then(
Expand Down Expand Up @@ -163,7 +163,7 @@ describe('remote account reset', function() {
.then(
function () {
// make sure we can still login after password reset
return Client.loginAndVerify(config.publicUrl, email, newPassword, server.mailbox, {keys:true})
return Client.login(config.publicUrl, email, newPassword, {keys:true})
}
)
.then(
Expand Down
1 change: 1 addition & 0 deletions test/remote/account_signin_verification_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ describe('remote account signin verification', function() {
let server
before(() => {
config.securityHistory.ipProfiling.allowedRecency = 0
config.signinConfirmation.skipForNewAccounts.enabled = false
return TestServer.start(config)
.then(s => {
server = s
Expand Down
2 changes: 1 addition & 1 deletion test/remote/flow_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe('remote flow', function() {
'e': '65537'
}
var duration = 1000 * 60 * 60 * 24 // 24 hours
return Client.loginAndVerify(config.publicUrl, email, password, server.mailbox, {keys:true})
return Client.login(config.publicUrl, email, password, server.mailbox, {keys:true})
.then(
function (x) {
client = x
Expand Down
2 changes: 2 additions & 0 deletions test/remote/password_change_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ describe('remote password change', function() {
let server
before(() => {
config.securityHistory.ipProfiling.allowedRecency = 0
config.signinConfirmation.skipForNewAccounts.enabled = false

return TestServer.start(config)
.then(s => {
server = s
Expand Down
2 changes: 1 addition & 1 deletion test/remote/password_forgot_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe('remote password forgot', function() {
)
.then( // make sure we can still login after password reset
function () {
return Client.loginAndVerify(config.publicUrl, email, newPassword, server.mailbox, {keys:true})
return Client.login(config.publicUrl, email, newPassword, {keys:true})
}
)
.then(
Expand Down
2 changes: 2 additions & 0 deletions test/remote/recovery_email_emails.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ describe('remote emails', function () {
enabledEmailAddresses: /\w/
}
config.securityHistory.ipProfiling = {}
config.signinConfirmation.skipForNewAccounts.enabled = false

return TestServer.start(config)
.then(s => {
server = s
Expand Down
1 change: 1 addition & 0 deletions test/remote/recovery_email_resend_code_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ describe('remote recovery email resend code', function() {
let server
before(() => {
config.securityHistory.ipProfiling.allowedRecency = 0
config.signinConfirmation.skipForNewAccounts.enabled = false

return TestServer.start(config)
.then(s => {
Expand Down
2 changes: 1 addition & 1 deletion test/remote/session_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ describe('remote session', function() {
.then(
function (x) {
assert.deepEqual(x, {
state: 'unverified',
state: 'verified',
uid: uid
})
}
Expand Down

0 comments on commit 9900c42

Please sign in to comment.