app/controllers/smoke_detectors_controller.rb
# Used by Helios to verify new tokens
Used by Helios to verify new tokens
Used by Helios to verify new tokens
def check_token
    token = SmokeDetector.where(access_token: params[:token]).first
    payload = {
      exists: token.present?,
      owner_name: token&.user&.username,
      location: token&.location,
      created_at: token&.created_at,
      updated_at: token&.updated_at
    }
    render json: payload
  end
def check_token token = SmokeDetector . where ( access_token : params [ :token ] ) . first payload = { exists : token . present? , owner_name : token &. user &. username , location : token &. location , created_at : token &. created_at , updated_at : token &. updated_at } render json : payload end
Used by Helios to verify new tokens
Used by Helios to verify new tokens