Correct guild pop up not showing on index and redirect error
This commit is contained in:
parent
ca068d49e8
commit
75aa1eb241
@ -53,7 +53,7 @@ public class GeneralWebView {
|
|||||||
model.addAttribute("isLogged", false);
|
model.addAttribute("isLogged", false);
|
||||||
model.addAttribute("guild_name", "");
|
model.addAttribute("guild_name", "");
|
||||||
model.addAttribute("isAdmin", false);
|
model.addAttribute("isAdmin", false);
|
||||||
return "index";
|
return CheckPage.getPageIfReady("index");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -85,7 +85,7 @@ public class GeneralWebView {
|
|||||||
response.addCookie(cookie);
|
response.addCookie(cookie);
|
||||||
}
|
}
|
||||||
model.addAttribute("redirect_url", System.getenv("OAUTH_URL"));
|
model.addAttribute("redirect_url", System.getenv("OAUTH_URL"));
|
||||||
return "login";
|
return CheckPage.getPageIfReady("login");
|
||||||
|
|
||||||
} catch (NumberFormatException e){
|
} catch (NumberFormatException e){
|
||||||
logger.debug("Unknown guild, flush cookies");
|
logger.debug("Unknown guild, flush cookies");
|
||||||
@ -93,7 +93,7 @@ public class GeneralWebView {
|
|||||||
cookie.setPath("/");
|
cookie.setPath("/");
|
||||||
cookie.setMaxAge(0);
|
cookie.setMaxAge(0);
|
||||||
response.addCookie(cookie);
|
response.addCookie(cookie);
|
||||||
return "redirect:index";
|
return "redirect:/";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -96,10 +96,10 @@ function getGuild(){
|
|||||||
}).done(function (data) {
|
}).done(function (data) {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
$('#guild_form').empty();
|
$('#guild_form').empty();
|
||||||
if(data.length === 0)
|
if(data.length === 0 && location.pathname !== "/")
|
||||||
window.location.replace("/");
|
window.location.replace("/");
|
||||||
|
|
||||||
if(data.length === 1){
|
else if(data.length === 1){
|
||||||
Cookies.set('guild', data[0].id, { expires: 31 });
|
Cookies.set('guild', data[0].id, { expires: 31 });
|
||||||
window.location.reload(true);
|
window.location.reload(true);
|
||||||
}
|
}
|
||||||
@ -172,7 +172,7 @@ function checkToken() {
|
|||||||
closeOnClick: false, // Closes side-nav on <a> clicks, useful for Angular/Meteor
|
closeOnClick: false, // Closes side-nav on <a> clicks, useful for Angular/Meteor
|
||||||
draggable: true // Choose whether you can drag to open on touch screens,
|
draggable: true // Choose whether you can drag to open on touch screens,
|
||||||
});
|
});
|
||||||
if (Cookies.get('guild') === undefined && location.pathname !== "/") {
|
if (Cookies.get('guild') === undefined ) {
|
||||||
getGuild()
|
getGuild()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user