diff options
author | Maxim Filippov <colixer@gmail.com> | 2019-09-24 13:00:48 +0300 |
---|---|---|
committer | Maxim Filippov <colixer@gmail.com> | 2019-09-24 13:00:48 +0300 |
commit | 5e9759cd7d0730c14bcc44e9b3dbda94947d602f (patch) | |
tree | 5917d89cad99d14a246e33f3e8ebd56e70abe20b /lib/pleroma/web/oauth/oauth_controller.ex | |
parent | 79c3443b609663ab23a4353ebdb7e5e2f0e6a150 (diff) | |
parent | 29dd8ab9c0ef28f9649fe0a5b29a0bbcfb4c0965 (diff) | |
download | pleroma-5e9759cd7d0730c14bcc44e9b3dbda94947d602f.tar.gz |
Merge branch 'develop' into feature/return-link-for-password-reset
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 |