Skip to content

Commit a6a3a72

Browse files
authored
Anonymous users should not connect to the WS (#500)
1 parent fd2dffb commit a6a3a72

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/stream_video/lib/src/stream_video.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,12 @@ class StreamVideo {
251251

252252
/// Connects the user to the Stream Video service.
253253
Future<Result<UserToken>> connect() async {
254+
if (currentUserType == UserType.anonymous) {
255+
_logger.w(() => '[connect] rejected (anonymous user)');
256+
return Result.error(
257+
'Cannot connect anonymous user to the WS due to Missing Permissions',
258+
);
259+
}
254260
_connectOperation ??= _connect().asCancelable();
255261
return _connectOperation!
256262
.valueOrDefault(Result.error('connect was cancelled'))

0 commit comments

Comments
 (0)