Merge branch 'develop' into feature/compat/push-subscriptions
authorEgor Kislitsyn <egor@kislitsyn.com>
Thu, 6 Dec 2018 13:15:16 +0000 (20:15 +0700)
committerEgor Kislitsyn <egor@kislitsyn.com>
Thu, 6 Dec 2018 13:15:16 +0000 (20:15 +0700)
# Conflicts:
# lib/pleroma/application.ex
# lib/pleroma/plugs/oauth_plug.ex

1  2 
lib/pleroma/application.ex
lib/pleroma/plugs/oauth_plug.ex
lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
lib/pleroma/web/router.ex
mix.exs
mix.lock

index d0f23527fb44bdf8824c589d34676f666152bcad,cc68d9669fe7a22cba9de9185e8d1b8f1f28d758..0b0ec01972a2cdb497b46e2bc49277b6b39030cb
@@@ -63,21 -64,17 +64,18 @@@ defmodule Pleroma.Application d
            ],
            id: :cachex_idem
          ),
-         worker(Pleroma.Web.Federator, []),
          worker(Pleroma.Web.Federator.RetryQueue, []),
-         worker(Pleroma.Gopher.Server, []),
+         worker(Pleroma.Web.Federator, []),
 -        worker(Pleroma.Stats, [])
 +        worker(Pleroma.Stats, []),
 +        worker(Pleroma.Web.Push, [])
        ] ++
-         if @env == :test,
-           do: [],
-           else:
-             [worker(Pleroma.Web.Streamer, [])] ++
-               if(
-                 !chat_enabled(),
-                 do: [],
-                 else: [worker(Pleroma.Web.ChatChannel.ChatChannelState, [])]
-               )
+         streamer_child() ++
+         chat_child() ++
+         [
+           # Start the endpoint when the application starts
+           supervisor(Pleroma.Web.Endpoint, []),
+           worker(Pleroma.Gopher.Server, [])
+         ]
  
      # See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
      # for other strategies and supported options
index 651485e092d53fbf1d7ded4828e599246859d762,75f9209c20cedc32227b35835d42bccfa5e7ba20..8b99a74d1f49f2c0d197990c86634adb797d86e0
@@@ -11,19 -15,9 +15,11 @@@ defmodule Pleroma.Plugs.OAuthPlug d
    def call(%{assigns: %{user: %User{}}} = conn, _), do: conn
  
    def call(conn, _) do
-     token =
-       case get_req_header(conn, "authorization") do
-         ["Bearer " <> header] -> header
-         _ -> get_session(conn, :oauth_token)
-       end
-     with token when not is_nil(token) <- token,
-          %Token{user_id: user_id} = token <- Repo.get_by(Token, token: token),
-          %User{} = user <- Repo.get(User, user_id),
-          false <- !!user.info["deactivated"] do
+     with {:ok, token} <- fetch_token(conn),
+          {:ok, user} <- fetch_user(token) do
 -      assign(conn, :user, user)
 +      conn
 +      |> assign(:token, token)
 +      |> assign(:user, user)
      else
        _ -> conn
      end
Simple merge
diff --cc mix.exs
Simple merge
diff --cc mix.lock
Simple merge