From 5a48bf1085f9fd4f10ea3706bacfe3b18fcc725c Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 1 May 2022 00:51:32 +0200 Subject: [PATCH] Fix error when trying to revoke OAuth token without supplying a token (#18205) --- app/controllers/oauth/tokens_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/oauth/tokens_controller.rb b/app/controllers/oauth/tokens_controller.rb index fa6d58f25..34087b20b 100644 --- a/app/controllers/oauth/tokens_controller.rb +++ b/app/controllers/oauth/tokens_controller.rb @@ -2,7 +2,8 @@ class Oauth::TokensController < Doorkeeper::TokensController def revoke - unsubscribe_for_token if authorized? && token.accessible? + unsubscribe_for_token if token.present? && authorized? && token.accessible? + super end