Add CORS support to OIDC

This commit is contained in:
theworldbright 2015-08-09 20:48:35 +09:00
parent 858e8c2503
commit 28fc65ae26
2 changed files with 9 additions and 3 deletions

View file

@ -3,6 +3,8 @@ module Api
class BaseController < ApplicationController
include Api::OpenidConnect::ProtectedResourceEndpoint
protected
def current_user
current_token ? current_token.authorization.user : nil
end

View file

@ -1,7 +1,11 @@
Rails.application.config.middleware.insert 0, Rack::Cors do
allow do
origins '*'
resource '/.well-known/host-meta'
resource '/webfinger'
origins "*"
resource "/.well-known/host-meta"
resource "/webfinger"
resource "/.well-known/webfinger"
resource "/.well-known/openid-configuration"
resource "/api/openid_connect/user_info", methods: :get
resource "/api/v0/*", methods: %i(get post delete)
end
end