Handle errors sent back over the sockt
This commit is contained in:
parent
b78276d23d
commit
326d346f92
4 changed files with 32 additions and 13 deletions
|
@ -63,7 +63,11 @@ class WebsocketController extends ClientApiController
|
|||
->expiresAt($now->addMinutes(15)->getTimestamp())
|
||||
->withClaim('user_id', $request->user()->id)
|
||||
->withClaim('server_uuid', $server->uuid)
|
||||
->withClaim('permissions', ['connect', 'send-command', 'send-power'])
|
||||
->withClaim('permissions', array_merge([
|
||||
'connect',
|
||||
'send-command',
|
||||
'send-power',
|
||||
], $request->user()->root_admin ? ['receive-errors'] : []))
|
||||
->getToken($signer, new Key($server->node->daemonSecret));
|
||||
|
||||
$socket = str_replace(['https://', 'http://'], ['wss://', 'ws://'], $server->node->getConnectionAddress());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue