commit 89c43cf45b679af2c42eaf4796b31e2bc2128403
parent c1685328ccf0947120a815d821c2cd580477c77a
Author: Marcel <MTRNord@users.noreply.github.com>
Date: Sat, 31 Dec 2016 18:37:43 +0100
Try to fix Cookies
Diffstat:
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/screencap.js b/screencap.js
@@ -31,14 +31,12 @@ function loadCookies(callback) {
while(!stream.atEnd()) {
var line = stream.readLine().split('=');
if(line[0] === 'SACSID') {
- SACSID = line[0];
- CSRF = line[1];
+ config.SACSID = line[1];
} else if(line[0] === 'csrftoken') {
- CSRF = line[1];
- SACSID = line[0];
+ config.CSRF = line[1];
} else {
- SACSID = '';
- CSRF = '';
+ config.SACSID = '';
+ config.CSRF = '';
}
}
stream.close();
@@ -64,10 +62,10 @@ function addCookies(sacsid, csrf) {
}
loadCookies(function() {
- if (SACSID == undefined || SACSID == '') {
+ if (config.SACSID == undefined || config.SACSID == '') {
firePlainLogin(user, pass, url);
} else {
- addCookies(SACSID, CSRF);
+ addCookies(config.SACSID, config.CSRF);
afterLogin(url, search, "cookie");
}
});