Add CORS support to OIDC
This commit is contained in:
parent
858e8c2503
commit
28fc65ae26
2 changed files with 9 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue