timestamps()
end
- def auth_active?(%User{} = user), do: user.info && !user.info.confirmation_pending
+ def auth_active?(%User{} = user) do
+ (user.info && !user.info.confirmation_pending) ||
+ !Pleroma.Config.get([:instance, :account_activation_required])
+ end
def superuser?(%User{} = user), do: user.info && User.Info.superuser?(user.info)
end
def try_send_confirmation_email(%User{} = user) do
- if user.info.confirmation_pending do
+ if user.info.confirmation_pending &&
+ Pleroma.Config.get([:instance, :account_activation_required]) do
user
|> Pleroma.UserEmail.account_confirmation_email()
|> Pleroma.Mailer.deliver()
describe "POST /api/account/resend_confirmation_email" do
setup do
+ setting = Pleroma.Config.get([:instance, :account_activation_required])
+
+ unless setting do
+ Pleroma.Config.put([:instance, :account_activation_required], true)
+ on_exit(fn -> Pleroma.Config.put([:instance, :account_activation_required], setting) end)
+ end
+
user = insert(:user)
info_change = User.Info.confirmation_changeset(user.info, :unconfirmed)