Apply suggestion to lib/pleroma/plugs/oauth_scopes_plug.ex
authorIvan Tashkinov <ivantbusiness@gmail.com>
Wed, 18 Sep 2019 10:31:10 +0000 (10:31 +0000)
committerIvan Tashkinov <ivantbusiness@gmail.com>
Wed, 18 Sep 2019 10:31:10 +0000 (10:31 +0000)
lib/pleroma/plugs/oauth_scopes_plug.ex

index e0d61c4ebebef059954a334b57c08f367bce2918..a3278dbefd02c9127b27b5649bcd6d02a950eae4 100644 (file)
@@ -61,9 +61,10 @@ defmodule Pleroma.Plugs.OAuthScopesPlug do
   end
 
   defp maybe_perform_instance_privacy_check(%Plug.Conn{} = conn, options) do
-    case options[:skip_instance_privacy_check] do
-      true -> conn
-      _ -> EnsurePublicOrAuthenticatedPlug.call(conn, [])
+    if options[:skip_instance_privacy_check] do
+      conn
+    else
+      EnsurePublicOrAuthenticatedPlug.call(conn, [])
     end
   end
 end