diff --git a/app/Traits/Controllers/JavascriptInjection.php b/app/Traits/Controllers/JavascriptInjection.php
index c6efc86a..8b41fca9 100644
--- a/app/Traits/Controllers/JavascriptInjection.php
+++ b/app/Traits/Controllers/JavascriptInjection.php
@@ -51,6 +51,7 @@ trait JavascriptInjection
'uuidShort' => $server->uuidShort,
'daemonSecret' => $token,
],
+ 'server_token' => $token,
'node' => [
'fqdn' => $server->node->fqdn,
'scheme' => $server->node->scheme,
diff --git a/public/themes/pterodactyl/js/frontend/server.socket.js b/public/themes/pterodactyl/js/frontend/server.socket.js
index d81c9eaf..ef698616 100644
--- a/public/themes/pterodactyl/js/frontend/server.socket.js
+++ b/public/themes/pterodactyl/js/frontend/server.socket.js
@@ -57,6 +57,17 @@ var Server = (function () {
'query': 'token=' + Pterodactyl.server.daemonSecret,
});
+ Socket.on('error', function (err) {
+ if(typeof notifySocketError !== 'object') {
+ notifySocketError = $.notify({
+ message: 'There was an error attempting to establish a WebSocket connection to the Daemon. This panel will not work as expected.
' + err,
+ }, {
+ type: 'danger',
+ delay: 0,
+ });
+ }
+ });
+
Socket.io.on('connect_error', function (err) {
if(typeof notifySocketError !== 'object') {
notifySocketError = $.notify({