Instead of returning a null token, assert
This commit is contained in:
parent
66d68c3df3
commit
313c0573e3
@ -63,7 +63,10 @@ Cloudron.prototype.getOauthToken = function (user) {
|
|||||||
|
|
||||||
////////// submit the login form with credentials
|
////////// 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();
|
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
|
sessionCookies = res.headers['set-cookie']; // always an array
|
||||||
assert.notStrictEqual(sessionCookies.length, 0);
|
assert.notStrictEqual(sessionCookies.length, 0);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user