about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-05-01 00:51:32 +0200
committerGitHub <noreply@github.com>2022-05-01 00:51:32 +0200
commit5a48bf1085f9fd4f10ea3706bacfe3b18fcc725c (patch)
tree565dfece499d7724bac55aa340ea2ffc8f68b3b5
parent6da648227ef59e5c77dc9d2c89a39eb5496a153e (diff)
Fix error when trying to revoke OAuth token without supplying a token (#18205)
-rw-r--r--app/controllers/oauth/tokens_controller.rb3
1 files changed, 2 insertions, 1 deletions
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