diff --git a/lib/websocket_rails/channel.rb b/lib/websocket_rails/channel.rb index 128ed3de..9e617cc5 100644 --- a/lib/websocket_rails/channel.rb +++ b/lib/websocket_rails/channel.rb @@ -65,9 +65,7 @@ def token private def generate_unique_token - begin - new_token = SecureRandom.uuid - end while channel_tokens.values.include?(new_token) + new_token = SecureRandom.uuid channel_manager.register_channel(@name, new_token)