Gokul595/api_guard

View on GitHub
app/controllers/api_guard/application_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# frozen_string_literal: true

module ApiGuard
  class ApplicationController < ActionController::Base
    skip_before_action :verify_authenticity_token, raise: false

    def authenticate_resource
      public_send("authenticate_and_set_#{resource_name}")
    end
  end
end