diff options
author | kPherox <admin@mail.kr-kp.com> | 2019-10-01 01:39:22 +0900 |
---|---|---|
committer | kPherox <admin@mail.kr-kp.com> | 2019-10-01 01:40:33 +0900 |
commit | a0f101ee806af06bcd4271cd8d57d11ff85ea11a (patch) | |
tree | 2cd3c5d1a645be1395c57ec5616f31afb4b68da7 /lib/pleroma/web/oauth/oauth_controller.ex | |
parent | 8ca4f145a51e92c9f3a6c374ceddfac22ea300d9 (diff) | |
parent | 7c9b023a918c84b60ae6547289a083c671a3659b (diff) | |
download | pleroma-a0f101ee806af06bcd4271cd8d57d11ff85ea11a.tar.gz |
Merge remote-tracking branch 'upstream/develop' into fix-prameter-name-of-accounts-update-credentials
Diffstat (limited to 'lib/pleroma/web/oauth/oauth_controller.ex')
-rw-r--r-- | lib/pleroma/web/oauth/oauth_controller.ex | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/pleroma/web/oauth/oauth_controller.ex b/lib/pleroma/web/oauth/oauth_controller.ex index 81eae2c8b..a57670e02 100644 --- a/lib/pleroma/web/oauth/oauth_controller.ex +++ b/lib/pleroma/web/oauth/oauth_controller.ex @@ -202,6 +202,8 @@ defmodule Pleroma.Web.OAuth.OAuthController do {:ok, app} <- Token.Utils.fetch_app(conn), {:auth_active, true} <- {:auth_active, User.auth_active?(user)}, {:user_active, true} <- {:user_active, !user.info.deactivated}, + {:password_reset_pending, false} <- + {:password_reset_pending, user.info.password_reset_pending}, {:ok, scopes} <- validate_scopes(app, params), {:ok, auth} <- Authorization.create_authorization(app, user, scopes), {:ok, token} <- Token.exchange_token(app, auth) do @@ -215,6 +217,9 @@ defmodule Pleroma.Web.OAuth.OAuthController do {:user_active, false} -> render_error(conn, :forbidden, "Your account is currently disabled") + {:password_reset_pending, true} -> + render_error(conn, :forbidden, "Password reset is required") + _error -> render_invalid_credentials_error(conn) end |