diff options
author | William Pitcock <nenolod@dereferenced.org> | 2018-06-14 02:29:52 +0000 |
---|---|---|
committer | William Pitcock <nenolod@dereferenced.org> | 2018-06-14 02:32:30 +0000 |
commit | 544246656906714b895e077f940900fb0cd07068 (patch) | |
tree | 57a5b4a222880218e3ecd2370048c4084a0d3f8c /lib | |
parent | ea42ba603fd0d3acd744f9f0b8ffb402e3ff1b2c (diff) | |
download | pleroma-544246656906714b895e077f940900fb0cd07068.tar.gz |
oauth: fix password-based login when username is email address
closes #199
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/oauth/oauth_controller.ex | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pleroma/web/oauth/oauth_controller.ex b/lib/pleroma/web/oauth/oauth_controller.ex index 3dd87d0ab..47962bbf8 100644 --- a/lib/pleroma/web/oauth/oauth_controller.ex +++ b/lib/pleroma/web/oauth/oauth_controller.ex @@ -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 |