projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'fix/put-repeats-at-activitypub-outbox' into 'develop'
[akkoma]
/
lib
/
pleroma
/
web
/
oauth
/
oauth_controller.ex
diff --git
a/lib/pleroma/web/oauth/oauth_controller.ex
b/lib/pleroma/web/oauth/oauth_controller.ex
index 47962bbf868cff4bc8635bfcb1f5b67427c003b9..a5fb32a4e774752c27537598f135470e71d59482 100644
(file)
--- a/
lib/pleroma/web/oauth/oauth_controller.ex
+++ b/
lib/pleroma/web/oauth/oauth_controller.ex
@@
-81,7
+81,7
@@
defmodule Pleroma.Web.OAuth.OAuthController do
# - investigate a way to verify the user wants to grant read/write/follow once scope handling is done
def token_exchange(
conn,
# - investigate a way to verify the user wants to grant read/write/follow once scope handling is done
def token_exchange(
conn,
- %{"grant_type" => "password", "name" => name, "password" => password} = params
+ %{"grant_type" => "password", "
user
name" => name, "password" => password} = params
) do
with %App{} = app <- get_app_from_request(conn, params),
%User{} = user <- User.get_by_nickname_or_email(name),
) do
with %App{} = app <- get_app_from_request(conn, params),
%User{} = user <- User.get_by_nickname_or_email(name),
@@
-104,6
+104,18
@@
defmodule Pleroma.Web.OAuth.OAuthController do
end
end
end
end
+ def token_exchange(
+ conn,
+ %{"grant_type" => "password", "name" => name, "password" => password} = params
+ ) do
+ params =
+ params
+ |> Map.delete("name")
+ |> Map.put("username", name)
+
+ token_exchange(conn, params)
+ end
+
defp fix_padding(token) do
token
|> Base.url_decode64!(padding: false)
defp fix_padding(token) do
token
|> Base.url_decode64!(padding: false)