[#114] Addressed warnings. Fix of `with` statement clause in `password_reset`.
[akkoma] / lib / pleroma / web / oauth / oauth_controller.ex
index 35c158fbbf7da4328316c64d8d9cae4c38f730f3..20c2e799bf8601f3cf3ef2b28ebe2d317e41ef1a 100644 (file)
@@ -121,7 +121,7 @@ defmodule Pleroma.Web.OAuth.OAuthController do
 
   def token_exchange(
         conn,
-        %{"grant_type" => "password", "name" => name, "password" => password} = params
+        %{"grant_type" => "password", "name" => name, "password" => _password} = params
       ) do
     params =
       params
@@ -143,8 +143,11 @@ defmodule Pleroma.Web.OAuth.OAuthController do
     end
   end
 
+  # XXX - for whatever reason our token arrives urlencoded, but Plug.Conn should be
+  # decoding it.  Investigate sometime.
   defp fix_padding(token) do
     token
+    |> URI.decode()
     |> Base.url_decode64!(padding: false)
     |> Base.url_encode64()
   end