mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
修复: oauth2 验证统一改为application控制器里的user_setup
This commit is contained in:
@@ -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,7 +21,7 @@ Doorkeeper.configure do
|
||||
access_token_generator '::Doorkeeper::JWT'
|
||||
|
||||
admin_authenticator do
|
||||
user = User.find_by_id(session[:www_user_id])
|
||||
user = current_user
|
||||
unless user && user.admin_or_business?
|
||||
redirect_to root_url
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user