fixed oauth2 管理员配置
This commit is contained in:
parent
1bc7c48876
commit
c50913495e
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue