class Hippo::API::Cable::Connection

Public Instance Methods

connect() click to toggle source
# File lib/hippo/api/cable.rb, line 16
def connect
    token = request.params['token']
    begin
        self.current_user = User.for_jwt_token(token) if token
    rescue JWT::DecodeError
    end
    unless self.current_user
        Hippo.logger.warn("Rejecting ws connection due to unauthorized access")
        reject_unauthorized_connection
    end
end

Protected Instance Methods

cookies() click to toggle source
# File lib/hippo/api/cable.rb, line 30
def cookies
    request.session
end