aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/oauth/oauth_controller.ex
diff options
context:
space:
mode:
authorMaxim Filippov <colixer@gmail.com>2019-09-26 19:01:54 +0300
committerMaxim Filippov <colixer@gmail.com>2019-09-26 19:01:54 +0300
commite7836adf21421de7a6d1d84fd605ec7d7f207cda (patch)
treeca378665486e37ec82a19feb95c84d2131b83e7a /lib/pleroma/web/oauth/oauth_controller.ex
parentdf15ed13d15db5b5a371345fcb9968b5af4100af (diff)
parent6abe12dceda8d0d32878208987a9631d5d546a3d (diff)
downloadpleroma-e7836adf21421de7a6d1d84fd605ec7d7f207cda.tar.gz
Merge branch 'develop' into feature/moderation-log-filters
Diffstat (limited to 'lib/pleroma/web/oauth/oauth_controller.ex')
-rw-r--r--lib/pleroma/web/oauth/oauth_controller.ex5
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