Instead of returning a null token, assert

This commit is contained in:
Johannes Zellner 2016-04-15 17:23:58 +02:00
parent 66d68c3df3
commit 313c0573e3
1 changed files with 4 additions and 1 deletions

View File

@ -63,7 +63,10 @@ Cloudron.prototype.getOauthToken = function (user) {
////////// submit the login form with credentials
res = request.post(this._origin + urlp.pathname).set('cookie', sessionCookies[0]).send({ _csrf: csrf, username: username, password: password }).redirects(0).end();
if (res.statusCode !== 302) return null;
if (res.statusCode !== 302) {
debug('Failed to submit the login for.', res.statusCode, res.text);
assert(false);
}
sessionCookies = res.headers['set-cookie']; // always an array
assert.notStrictEqual(sessionCookies.length, 0);