Seperated out socket validation/authorization from channel mangement logic.
This commit is contained in:
parent
d541dce8c4
commit
7da07c8717
4 changed files with 108 additions and 74 deletions
|
|
@ -89,11 +89,11 @@ class channel{
|
|||
|
||||
this.socket.on("kick", async (data) => {
|
||||
if(data.reason == "Invalid CSRF Token!"){
|
||||
//Reload the CSRF token
|
||||
await utils.ajax.reloadCSRFToken();
|
||||
//Warn the user
|
||||
new canopyUXUtils.popup('Invalid CSRF Token detected, reloading client...');
|
||||
|
||||
//Retry the connection
|
||||
this.connect();
|
||||
//Just reload the fucker
|
||||
setTimeout(()=>{location.reload();}, 1000);
|
||||
}else{
|
||||
new canopyUXUtils.popup(`You have been ${data.type} from the channel for the following reason:<br>${data.reason}`);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue