]> cat aescling's git repositories - mastodon.git/commitdiff
Fix error when trying to revoke OAuth token without supplying a token (#18205)
authorEugen Rochko <eugen@zeonfederated.com>
Sat, 30 Apr 2022 22:51:32 +0000 (00:51 +0200)
committersingle-right-quote <11325618-aescling@users.noreply.gitlab.com>
Thu, 5 May 2022 17:49:13 +0000 (13:49 -0400)
app/controllers/oauth/tokens_controller.rb

index fa6d58f25832f89e463f1a07b675b4c46eb888da..34087b20bc3b68245db76ea0149eb22451b37151 100644 (file)
@@ -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