Merge branch 'bugfix/oauth2-param-name' into 'develop'
[akkoma] / lib / pleroma / web / oauth / oauth_controller.ex
index cdfae8b6ae444e64fbcfe1fd119e97c278cf0247..a5fb32a4e774752c27537598f135470e71d59482 100644 (file)
@@ -84,7 +84,7 @@ defmodule Pleroma.Web.OAuth.OAuthController do
         %{"grant_type" => "password", "username" => name, "password" => password} = params
       ) do
     with %App{} = app <- get_app_from_request(conn, params),
-         %User{} = user <- User.get_cached_by_nickname(name),
+         %User{} = user <- User.get_by_nickname_or_email(name),
          true <- Pbkdf2.checkpw(password, user.password_hash),
          {:ok, auth} <- Authorization.create_authorization(app, user),
          {:ok, token} <- Token.exchange_token(app, auth) do