diff options
Diffstat (limited to 'frontend/static/js/src')
| -rw-r--r-- | frontend/static/js/src/api.js | 10 | ||||
| -rw-r--r-- | frontend/static/js/src/auth.js | 11 | ||||
| -rwxr-xr-x | frontend/static/js/src/soundmanager2.js (renamed from frontend/static/js/src/soundmanager.js) | 0 |
3 files changed, 19 insertions, 2 deletions
diff --git a/frontend/static/js/src/api.js b/frontend/static/js/src/api.js index 797823e..3a0cd14 100644 --- a/frontend/static/js/src/api.js +++ b/frontend/static/js/src/api.js @@ -6,7 +6,7 @@ var API = { auth: { - login: "/api/auth/login", + login: "/api/auth/login", logout: "/api/auth/logout", checkin: "/api/auth/checkin", sneakin: "/api/auth/sneakin", @@ -64,6 +64,14 @@ var API = } } // $.ajaxSetup({ timeout: 1000 }) + $.ajaxSetup({ + type: "POST", + xhrFields: { + withCredentials: true + }, + }); +//API.js seems fairly global still no cookie looks good need to check database if it's was updated +//for my user, right? yep } } var Local = diff --git a/frontend/static/js/src/auth.js b/frontend/static/js/src/auth.js index 26da79d..42a92c5 100644 --- a/frontend/static/js/src/auth.js +++ b/frontend/static/js/src/auth.js @@ -36,15 +36,24 @@ var Auth = document.cookie = "session="+Auth.session+";path=/;domain=.scannerjammer.com;max-age=1086400" Auth.success() }, +//http://i.imgur.com/kqpf9wX.png yes i see so do we just need to add cors headers? yes, what about nginx, did we restart it? +//no good yet checkin: function () { d.warn("CHECK IN") - $.post(API.URL.auth.checkin, {'session':Auth.session}, Auth.checkinCallback) + $.ajax(API.URL.auth.checkin, { + type: "POST", + data: { 'session':Auth.session, }, + xhrFields: { + withCredentials: true + }, + }).success(Auth.checkinCallback); }, checkinCallback: function (raw) { var lines = API.parse("/auth/checkin", raw) if (! lines.length) return + //so we should just return "OK" right? looks sso if (lines[0] !== "OK") { alert(lines[0].split("\t")[1]) diff --git a/frontend/static/js/src/soundmanager.js b/frontend/static/js/src/soundmanager2.js index 46528c9..46528c9 100755 --- a/frontend/static/js/src/soundmanager.js +++ b/frontend/static/js/src/soundmanager2.js |
