Class: AuthProvider::ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/auth_provider/application_controller.rb

Direct Known Subclasses

TokensController

Instance Method Summary collapse

Instance Method Details

#cors_preflight_checkObject



5
6
7
8
9
10
11
12
13
# File 'app/controllers/auth_provider/application_controller.rb', line 5

def cors_preflight_check
  if request.method_symbol == :options
    headers['Access-Control-Allow-Origin'] = '*'
    headers['Access-Control-Allow-Methods'] = 'OPTIONS, GET, POST, PUT, PATCH, DELETE'
    headers['Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization'
    headers['Access-Control-Max-Age'] = '1728000'
    head 200
  end
end