fixed oauth2 管理员配置

This commit is contained in:
xiaoxiaoqiong 2022-07-06 10:27:35 +08:00
parent 1bc7c48876
commit c50913495e
1 changed files with 2 additions and 2 deletions

View File

@ -20,8 +20,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 || User.find_by_id(session[:www_user_id])
unless user && user.admin_or_business?
redirect_to root_url
end
end