Skip to content

Commit 21395bc

Browse files
author
prophet777
committed
Fix roles issue #51
1 parent 2dd2929 commit 21395bc

File tree

3 files changed

+18
-20
lines changed

3 files changed

+18
-20
lines changed

Client/Auth/WebsocketAuthenticationProvider.php

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ public function __construct(
5252
$this->logger = null === $logger ? new NullLogger() : $logger;
5353
}
5454

55+
/**
56+
* @param ConnectionInterface $connection
57+
*
58+
* @return TokenInterface
59+
*/
5560
protected function getToken(ConnectionInterface $connection)
5661
{
5762
$token = null;
@@ -78,14 +83,19 @@ protected function getToken(ConnectionInterface $connection)
7883
}
7984

8085
/**
81-
* @param TokenInterface $token
86+
* @param ConnectionInterface $conn
87+
*
88+
* @return TokenInterface
89+
*
90+
* @throws StorageException
91+
* @throws \Exception
8292
*/
8393
public function authenticate(ConnectionInterface $conn)
8494
{
8595
if (1 === count($this->firewalls) && 'ws_firewall' === $this->firewalls[0]) {
8696
$this->logger->warning(sprintf(
87-
'User firewall is not configured, we have set %s by default',
88-
$this->firewalls[0])
97+
'User firewall is not configured, we have set %s by default',
98+
$this->firewalls[0])
8999
);
90100
}
91101

@@ -114,21 +124,10 @@ public function authenticate(ConnectionInterface $conn)
114124
$conn->WAMP->clientStorageId = $identifier;
115125

116126
$this->logger->info(sprintf(
117-
'%s connected [%]',
118-
$username,
119-
$user instanceof UserInterface ? implode(', ', $user->getRoles()) : array()
127+
'%s connected',
128+
$username
120129
), $loggerContext);
121130

122131
return $token;
123132
}
124-
125-
/**
126-
* @param TokenInterface $token
127-
*
128-
* @return bool
129-
*/
130-
public function supports(TokenInterface $token)
131-
{
132-
return $token instanceof WebsocketToken;
133-
}
134133
}

Client/Driver/PredisDriver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class PredisDriver implements DriverInterface
1515
protected $client;
1616

1717
/**
18-
* string $prefix
18+
* string $prefix.
1919
*/
2020
protected $prefix;
2121

Event/ClientEventListener.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,8 @@ public function onClientDisconnect(ClientEvent $event)
9292
$loggerContext['username'] = $username;
9393

9494
$this->logger->info(sprintf(
95-
'%s disconnected [%]',
96-
$username,
97-
$user instanceof UserInterface ? implode(', ', $user->getRoles()) : array()
95+
'%s disconnected',
96+
$username
9897
), $loggerContext);
9998
} catch (ClientNotFoundException $e) {
10099
$this->logger->info('user timed out', $loggerContext);

0 commit comments

Comments
 (0)