Created
July 9, 2016 14:42
-
-
Save evanjmg/31381cc7abb8d623c9ee242f8b91ebe6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in routes.rb add your endpoint | |
post 'pusher/auth', to: "pusher#auth" | |
# create a pusher_controller.rb in your api | |
class Api::V1::PusherController < Api::V1::BaseController | |
skip_authorization_check | |
skip_before_filter :check_api_auth!, only: [:auth] | |
def auth | |
if current_user | |
response = Pusher.authenticate(params[:channel_name], params[:socket_id]) | |
render json: response | |
else | |
head :forbidden | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment