Merge branch 'bugfix/peertube-mpegURL-object' into 'develop'
[akkoma] / lib / pleroma / web / plugs / o_auth_plug.ex
index a3b7d42f749dba5687f799d5d72f87536092361f..5e06ac3f68ea17a0111c4b560d91c2fe717414aa 100644 (file)
@@ -1,5 +1,5 @@
 # Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.Web.Plugs.OAuthPlug do
@@ -8,6 +8,7 @@ defmodule Pleroma.Web.Plugs.OAuthPlug do
   import Plug.Conn
   import Ecto.Query
 
+  alias Pleroma.Helpers.AuthHelper
   alias Pleroma.Repo
   alias Pleroma.User
   alias Pleroma.Web.OAuth.App
@@ -98,7 +99,7 @@ defmodule Pleroma.Web.Plugs.OAuthPlug do
 
   @spec fetch_token_from_session(Plug.Conn.t()) :: :no_token_found | {:ok, String.t()}
   defp fetch_token_from_session(conn) do
-    case get_session(conn, :oauth_token) do
+    case AuthHelper.get_session_token(conn) do
       nil -> :no_token_found
       token -> {:ok, token}
     end