diaspora/app/controllers/api/openid_connect/user_info_controller.rb
theworldbright d834a1d4d0 Replace user info endpoint with supported claims
The route /api/v0/user/ will now be used as a
non-OIDC route. In other words, the /api/v0/user/
will require the "read" scope while
/api/openid_connect/user_info/ will require the
"openid" scope
2016-01-04 16:49:51 +09:00

19 lines
467 B
Ruby

module Api
module OpenidConnect
class UserInfoController < ApplicationController
include Api::OpenidConnect::ProtectedResourceEndpoint
before_action do
require_access_token Api::OpenidConnect::Scope.find_by(name: "openid")
end
def show
render json: current_user, serializer: UserInfoSerializer
end
def current_user
current_token ? current_token.authorization.user : nil
end
end
end
end