removed unnecesarry cookie stuff

This commit is contained in:
MrFry 2020-04-03 17:21:48 +02:00
parent daeb08341b
commit d9f9a16b49

View file

@ -735,7 +735,6 @@
SendXHRMessage('login', { pw: pw, script: true }) SendXHRMessage('login', { pw: pw, script: true })
.then((res) => { .then((res) => {
if (res.result === 'success') { if (res.result === 'success') {
setVal('sessionID', res.sessionID)
ConnectToServer(AfterLoad) ConnectToServer(AfterLoad)
ClearAllMessages() ClearAllMessages()
setPassiveButtonState(false) setPassiveButtonState(false)
@ -748,7 +747,6 @@
} }
function ConnectToServer (cwith) { function ConnectToServer (cwith) {
setVal('sessionID', 'gfdgkldf')
ClearAllMessages() ClearAllMessages()
GetXHRInfos().then((inf) => { GetXHRInfos().then((inf) => {
if (inf.result === 'nouser') { if (inf.result === 'nouser') {
@ -1699,12 +1697,10 @@
info().script.version + info().script.version +
'&cid=' + GetId() '&cid=' + GetId()
console.log(getVal('sessionID'))
xmlhttpRequest({ xmlhttpRequest({
method: 'GET', method: 'GET',
url: url, url: url,
headers: { headers: {
'Cookie': `sessionID=${getVal('sessionID')}`,
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
onload: function (response) { onload: function (response) {
@ -1793,14 +1789,12 @@
} }
const url = apiAdress + path const url = apiAdress + path
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
console.log(getVal('sessionID'))
xmlhttpRequest({ xmlhttpRequest({
method: 'POST', method: 'POST',
url: url, url: url,
xhrFields: { withCredentials: true }, xhrFields: { withCredentials: true },
data: message, data: message,
headers: { headers: {
'Cookie': `sessionID=${getVal('sessionID')}`,
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
onerror: function (e) { onerror: function (e) {