Waiting for email...
{ code: 401,
errno: 110,
error: 'Unauthorized',
message: 'Invalid authentication token in request signature',
info: 'https://github.com/mozilla/fxa-auth-server/blob/master/docs/api.md#response-format',
log:
[ { op: 'server.onRequest', rid: '1393349834041-53303-39366' },
{ op: 'DB.getToken',
id: 'e27ab22dff6a76bff8581314a7e9afb7af4ec5d01e6757aea33600c8d8bb536c',
rid: '1393349834041-53303-39366' },
{ op: 'Heap.sessionToken',
id: 'e27ab22dff6a76bff8581314a7e9afb7af4ec5d01e6757aea33600c8d8bb536c',
rid: '1393349834041-53303-39366' } ] }
FAIL: main - account - #reset password (42ms)
-
-
Save vladikoff/ee583aca7dbf4a863ba5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sign up | |
return respond(client.signUp(email, password), RequestMocks.signUp) | |
.then(function (result) { | |
uid = result.uid; | |
assert.ok(uid, "uid is returned"); | |
sessionToken = result.sessionToken; | |
// start password forgot | |
return respond(client.passwordForgotSendCode(email), RequestMocks.passwordForgotSendCode); | |
}) | |
.then(function (result) { | |
passwordForgotToken = result.passwordForgotToken; | |
assert.ok(passwordForgotToken, "passwordForgotToken is returned"); | |
// wait for reset email | |
return respond(mail.wait(user, 2), RequestMocks.resetMail); | |
}) | |
.then(function (emails) { | |
var code = emails[1].html.match(/code=([A-Za-z0-9]+)/)[1]; | |
assert.ok(code, "code is returned: " + code); | |
// confirm code | |
return respond(client.passwordForgotVerifyCode(code, passwordForgotToken), RequestMocks.passwordForgotVerifyCode); | |
}) | |
.then(function (result) { | |
accountResetToken = result.accountResetToken; | |
var newPassword = 'newturles'; | |
assert.ok(accountResetToken, "accountResetToken is returned"); | |
// account reset | |
return respond(client.accountReset(email, newPassword, accountResetToken), RequestMocks.accountReset); | |
}) | |
.then(function() { | |
// try to get devices for the logged in session | |
return respond(client.accountDevices(sessionToken), RequestMocks.accountDevices) | |
}) | |
.then( | |
function(res) { | |
assert.property(res, 'devices'); | |
}, | |
function(err) { | |
// errors | |
console.log(err); | |
assert.fail(); | |
} | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment