You’re not receiving notifications from this thread.
How do I switch off Devise authorization for API requests?
I have 2 URL's to access the same Rails application. One URL is internal to our network and does not require authentication. The other is accessible outside our network and does require authentication. I put the following code in the app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
before_action :authenticate_user!, if: :outside_the_network_is_true?
logger.info 'request.original_url[7..9] = ' + request.original_url[7..9]
outside_the_network = false
if request.original_url[7..9] == 'ops'
outside_the_network = true
Any help would be much appreciated.