Seperated out socket validation/authorization from channel mangement logic.

This commit is contained in:
rainbow napkin 2025-09-18 04:13:19 -04:00
parent d541dce8c4
commit 7da07c8717
4 changed files with 108 additions and 74 deletions

View file

@ -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}`);
}