修复:cherry pick doorkeeper配置

This commit is contained in:
2022-07-11 18:50:13 +08:00
parent fbbacfa983
commit 4ed3a9d478
2 changed files with 17 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
# frozen_string_literal: true
Doorkeeper.configure do
base_controller 'ApplicationController'
# Change the ORM that doorkeeper will use (requires ORM extensions installed).
# Check the list of supported ORMs here: https://github.com/doorkeeper-gem/doorkeeper#orms
orm :active_record
@@ -20,8 +21,8 @@ Doorkeeper.configure do
access_token_generator '::Doorkeeper::JWT'
admin_authenticator do
user = User.find_by_id(session[:www_user_id])
unless user #&& user.admin_or_business?
user = current_user
unless user && user.admin_or_business?
redirect_to root_url
end
end