def authenticate_subscribe(message)
      subscription = Danthes.subscription(channel: message['subscription'],
                                          timestamp: message['ext']['danthes_timestamp'])
      if message['ext']['danthes_signature'] != subscription[:signature]
        message['error'] = 'Incorrect signature.'
      elsif Danthes.signature_expired? message['ext']['danthes_timestamp'].to_i
        message['error'] = 'Signature has expired.'
      end
    end
def authenticate_subscribe(message)
      subscription = Danthes.subscription(channel: message['subscription'],
                                          timestamp: message['ext']['danthes_timestamp'])
      if message['ext']['danthes_signature'] != subscription[:signature]
        message['error'] = 'Incorrect signature.'
      elsif Danthes.signature_expired? message['ext']['danthes_timestamp'].to_i
        message['error'] = 'Signature has expired.'
      end
    end
Ensure the subscription signature is correct and that it has not expired.