debug the html should the redirectUrl detection fail
This commit is contained in:
parent
b19d5a1d66
commit
de990f0765
@ -41,7 +41,12 @@ Cloudron.prototype.getOauthToken = function (user) {
|
||||
var sessionCookies = res.headers['set-cookie']; // always an array
|
||||
|
||||
///////// should get redirected to login form with a script tag (to workaround chrome issue with redirects+cookies)
|
||||
var urlp = url.parse(res.text.match(/window.location.href = "(.*)"/)[1]);
|
||||
var redirectUrl = res.text.match(/window.location.href = "(.*)"/);
|
||||
if (!redirectUrl) {
|
||||
debug('Could not determine redirected url', res.text);
|
||||
assert(false);
|
||||
}
|
||||
var urlp = url.parse(redirectUrl[1]);
|
||||
|
||||
////////// get the login form (api/v1/session/login)
|
||||
res = request.get(this._origin + urlp.pathname).set('cookie', sessionCookies[0]).query(urlp.query).end();
|
||||
|
Loading…
Reference in New Issue
Block a user