diff options
| author | _Tradam <[email protected]> | 2024-06-17 00:30:36 -0400 |
|---|---|---|
| committer | _Tradam <[email protected]> | 2024-06-17 00:30:36 -0400 |
| commit | d4fe606b702ffc452cedcc7a6c555c04620dc3f1 (patch) | |
| tree | 2b240460addce88775b995c366fbd1d36f124cc2 | |
| parent | a30c228989b2759c812c87c5a1239e4f8d9ab5c8 (diff) | |
| download | gameHolster-d4fe606b702ffc452cedcc7a6c555c04620dc3f1.tar.gz gameHolster-d4fe606b702ffc452cedcc7a6c555c04620dc3f1.zip | |
test automated deployment
| -rw-r--r-- | app/controllers/api/v1/auth_controller.rb | 1 | ||||
| -rw-r--r-- | app/controllers/application_controller.rb | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/app/controllers/api/v1/auth_controller.rb b/app/controllers/api/v1/auth_controller.rb index 3a248cd..dd77c6a 100644 --- a/app/controllers/api/v1/auth_controller.rb +++ b/app/controllers/api/v1/auth_controller.rb @@ -2,6 +2,7 @@ require 'net/http' require 'bcrypt' class Api::V1::AuthController < ApplicationController + before_filter :cors_accept class << self end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 31e16d7..427556c 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,4 +1,11 @@ class ApplicationController < ActionController::API include ActionController::Cookies include ActionController::RequestForgeryProtection + + def cors_accept + headers['Access-Control-Allow-Origin'] = '*' + headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS' + headers['Access-Control-Request-Method'] = '*' + headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization' + end end |
