[#114] Account confirmation email, registration as unconfirmed (config-based), auth prevention for unconfirmed.

This commit is contained in:
Ivan Tashkinov 2018-12-17 17:28:58 +03:00
commit 1de0aa2f10
8 changed files with 67 additions and 6 deletions

View file

@ -31,6 +31,7 @@ defmodule Pleroma.Web.OAuth.OAuthController do
}) do
with %User{} = user <- User.get_by_nickname_or_email(name),
true <- Pbkdf2.checkpw(password, user.password_hash),
true <- User.auth_active?(user),
%App{} = app <- Repo.get_by(App, client_id: client_id),
{:ok, auth} <- Authorization.create_authorization(app, user) do
# Special case: Local MastodonFE.
@ -101,6 +102,7 @@ defmodule Pleroma.Web.OAuth.OAuthController do
with %App{} = app <- get_app_from_request(conn, params),
%User{} = user <- User.get_by_nickname_or_email(name),
true <- Pbkdf2.checkpw(password, user.password_hash),
true <- User.auth_active?(user),
{:ok, auth} <- Authorization.create_authorization(app, user),
{:ok, token} <- Token.exchange_token(app, auth) do
response = %{