Skip to content
Snippets Groups Projects
Commit 280ac243 authored by lain's avatar lain
Browse files

Merge branch 'bugfix/oauth-password-with-email' into 'develop'

oauth: fix password-based login when username is email address

Closes #199

See merge request pleroma/pleroma!220
parents 408152e2 54424665
No related branches found
No related tags found
No related merge requests found
......@@ -84,7 +84,7 @@ defmodule Pleroma.Web.OAuth.OAuthController do
%{"grant_type" => "password", "name" => 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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment