Method: Pusher::Channel#authenticate
- Defined in:
- lib/pusher/channel.rb
#authenticate(socket_id, custom_data = nil) ⇒ Hash
Generate the expected response for an authentication endpoint. See pusher.com/docs/authenticating_users for details.
158 159 160 161 162 163 164 |
# File 'lib/pusher/channel.rb', line 158 def authenticate(socket_id, custom_data = nil) custom_data = MultiJson.encode(custom_data) if custom_data auth = authentication_string(socket_id, custom_data) r = {:auth => auth} r[:channel_data] = custom_data if custom_data r end |