reverted authListener changed the correct function

Ok. actually fixes #20 without breaking other stuff.
This commit is contained in:
Kevin Ramharak 2018-01-03 06:13:31 +01:00 committed by GitHub
parent dac61bf051
commit 2a0c3992f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -791,18 +791,6 @@ function manhanttanDistance(x1, y1, x2, y2) {
}
function codeListener(message) {
if (message.t === "code") {
ace.edit("editor").setValue(message.code);
}
}
/**
* Listens for authentications responses from the server
*/
function authListener(message) {
if (message.t === "code") {
var code = message.code;
if(typeof window.localStorage !== 'undefined') { // localStorage is supported
@ -816,6 +804,22 @@ function authListener(message) {
}
}
/**
* Listens for authentications responses from the server
*/
function authListener(message) {
if (message.t === "auth") {
if (message.m === "ok") {
console.log("Auth successful");
mar.client.requestUserInfo();
} else {
alert("Authentication failed. Please make sure you are logged in and reload the page.");
}
}
}
function codeResponseListener(message) {
if (message.t === "codeResponse") {