Merge branch 'feature/1584-client-captcha-options' into 'develop'

Creating trusted app from adminFE & mix task

Closes #1584

See merge request pleroma/pleroma!2252
This commit is contained in:
Haelwenn 2020-04-17 09:19:35 +00:00
commit a17bfb5fab
15 changed files with 678 additions and 3 deletions

View file

@ -13,6 +13,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
def register_user(params, opts \\ []) do
token = params["token"]
trusted_app? = params["trusted_app"]
params = %{
nickname: params["nickname"],
@ -29,7 +30,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
captcha_enabled = Pleroma.Config.get([Pleroma.Captcha, :enabled])
# true if captcha is disabled or enabled and valid, false otherwise
captcha_ok =
if not captcha_enabled do
if trusted_app? || not captcha_enabled do
:ok
else
Pleroma.Captcha.validate(