diff options
author | lambda <lain@soykaf.club> | 2019-04-02 10:57:38 +0000 |
---|---|---|
committer | lambda <lain@soykaf.club> | 2019-04-02 10:57:38 +0000 |
commit | 091baf93169895c62418ccee81b80d00416aaa56 (patch) | |
tree | 4498be40963cab228027d38525b7a6f65d7f47a4 /lib/pleroma/web/controller_helper.ex | |
parent | 26d509cc861ad865b12d187fc163fa78c4c128a7 (diff) | |
parent | 15ce7104608869cb62c72c5beef0b23b1150cda0 (diff) | |
download | pleroma-091baf93169895c62418ccee81b80d00416aaa56.tar.gz |
Merge branch 'features/mastoapi/2.6.0-force-login-option' into 'develop'
MastoAPI 2.6.0 `force_login` option
Closes #734
See merge request pleroma/pleroma!999
Diffstat (limited to 'lib/pleroma/web/controller_helper.ex')
-rw-r--r-- | lib/pleroma/web/controller_helper.ex | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/pleroma/web/controller_helper.ex b/lib/pleroma/web/controller_helper.ex index 4d6192db0..181483664 100644 --- a/lib/pleroma/web/controller_helper.ex +++ b/lib/pleroma/web/controller_helper.ex @@ -5,6 +5,11 @@ defmodule Pleroma.Web.ControllerHelper do use Pleroma.Web, :controller + # As in MastoAPI, per https://api.rubyonrails.org/classes/ActiveModel/Type/Boolean.html + @falsy_param_values [false, 0, "0", "f", "F", "false", "FALSE", "off", "OFF"] + def truthy_param?(blank_value) when blank_value in [nil, ""], do: nil + def truthy_param?(value), do: value not in @falsy_param_values + def oauth_scopes(params, default) do # Note: `scopes` is used by Mastodon — supporting it but sticking to # OAuth's standard `scope` wherever we control it |