From db736cae66a51060b9dcf7ec560eee8308f266e3 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Wed, 16 Oct 2024 13:44:55 +0800 Subject: [PATCH] =?UTF-8?q?oauth2=E5=B7=B2=E7=99=BB=E5=BD=95=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/oauth2_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/oauth2_controller.rb b/app/controllers/oauth2_controller.rb index 9be575a1f..1e14e88b0 100644 --- a/app/controllers/oauth2_controller.rb +++ b/app/controllers/oauth2_controller.rb @@ -1,4 +1,4 @@ -class Oauth2Controller < ActionController::Base +class Oauth2Controller < ApplicationController layout 'doorkeeper/application' include LoginHelper @@ -6,6 +6,9 @@ class Oauth2Controller < ActionController::Base client_id = params[:call_url].split("client_id=")[1].split("&redirect_uri")[0] @call_url = request.fullpath.split('call_url=').last @app = Doorkeeper::Application.find_by(uid: client_id) + if User.current.logged? + redirect_to @call_url + "&auth=" + @user.login + end end def create