Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}).then((status) => {
assert.equal(status.verified, false, 'email status now reports unverified, because mustVerify=true')
// The reauth should have triggerd a verification email.
return server.mailbox.waitForCode(email)
}).then((code) => {
return client.verifyEmail(code)
function (status) {
// Verify correct status
assert.equal(status.verified, false, 'account is unverified')
assert.equal(status.emailVerified, true, 'account email is verified')
assert.equal(status.sessionVerified, false, 'account session is unverified')
}
)
it('should have a chainable tap function that passes the value to a function', function () {
var chain = shackles()
var myval = null
var result = chain(10)
.tap(function(value) {
myval = value * 2
})
.value()
assert.equal(result, 10)
assert.equal(myval, 20)
})
it('should override the boxed value with the value that the tap callback returns', function () {
var chain = shackles()
var result = chain(10)
.tap(function(value) {
return value/2
})
.value()
assert.equal(result, 5)
})
})
it('should override the boxed value with any scalar properties that are called as chained functions', function () {
var chain = shackles({
num: 10
})
var result = chain('dummy')
.num()
.value()
assert.equal(result, 10)
})
}).then(function(res) {
assert.equal(res.statusCode, 200);
assert(res.result.expires_in);
assert(res.result.access_token);
assert.equal(res.result.refresh_token, undefined);
});
});
}).then(function(res) {
assert.equal(res.statusCode, 200);
assert(res.result.expires_in);
assert(res.result.access_token);
assert.equal(res.result.refresh_token, undefined);
});
});
}).then(function(res) {
assert.equal(res.statusCode, 200);
assertSecurityHeaders(res);
assert.equal(res.result.user, USERID);
assert.equal(res.result.client_id, clientId);
assert.equal(res.result.scope[0], 'profile');
assert.equal(res.result.email, undefined);
assert.equal(res.result.profile_changed_at, undefined);
});
});
}).then(function(res) {
assert.equal(res.statusCode, 200);
assertSecurityHeaders(res);
assert.equal(res.result.user, USERID);
assert.equal(res.result.client_id, clientId);
assert.equal(res.result.scope[0], 'profile');
assert.equal(res.result.email, VEMAIL);
});
});
return newToken({ scope: 'openid' }, { verifierResponse }).then(res => {
assert.equal(res.statusCode, 200);
assertSecurityHeaders(res);
assert(res.result.id_token);
const jwt = decodeJWT(res.result.id_token);
const claims = jwt.claims;
assert.equal(claims.sub, USERID);
assert.equal(claims.aud, clientId);
assert.equal(claims.iss, config.get('openid.issuer'));
assert.equal(claims.amr, undefined);
assert.equal(claims.acr, ACR);
assert.equal(claims['fxa-aal'], AAL);
});
});