docbrown/app
Daniel Uber c489971ecf
Allow admin control of auth broadcast messages (was: Don't suggest apple authentication) (#16069)
* Don't send auth broadcasts for providers that are in beta

Currently we have :apple as a restricted provider (you can enable it,
but it's treated as beta here, rather than generally available).

While we were correctly checking if you had all GA providers enabled
in authenticated_with_all_providers?, we were incorrectly pulling
all enabled provider names in find_auth_broadcast (the message to send
the user), and picking apple_connect.

Since it doesn't make sense to omit apple id login from consideration
when checking if all available auth methods are used, then recommend
that it be used consistently, capture this "GA" state as a method, and
use it both in the test "does this user have all available identity
providers enabled?" and the selection "which identity provider can I
suggest they setup?" consistently.

Since we're about to enable google as an auth source (in #15986) I'll
check with Josh if he expects this to be GA on release or in limited
beta.

* Clean up authenticated_with_all_providers?

We have a method identities that returns the enabled identities for
the user (a relation), and a method ga_providers that returns a list
of enabled and not beta provider symbols.

Change the set difference to use Array#all? (which will exit early on
the first failure). Efficiency note: while I think this reads
better,it's possible this issues a number of small (cheap) queries for
identity by user id and provider id, but there's a unique index on
(provider, user_id) that should be effective.

* Only check providers that have active broadcast messages

An admin can stop sending "connect using apple" follow ups by
disabling that broadcast.

I randomized the enabled/active broadcasts for connection options so
they're not always pulling the same (facebook? apple?) option every
time.

* Clean up lost thought in comment
2022-01-12 09:59:14 -06:00
..
assets Adjust in-feed-comment p margin for readability (#16068) 2022-01-12 07:46:04 -05:00
black_box Make Rubocop happy again (#14729) 2021-09-14 09:15:01 -05:00
components/admin/users Small change to make the tools section of member details mobile friendly. (#15159) 2021-10-22 18:47:20 +02:00
controllers Proposing feed experiment 3: More comment count weight (#15993) 2022-01-11 11:05:06 -05:00
decorators role deprecation cleanup (#15717) 2021-12-09 15:27:45 -06:00
errors small non-views ruby i18n (#16004) 2022-01-11 10:05:18 +07:00
forms Using a Form Object that will persist for the Creator Settings Form (#15684) 2021-12-10 17:07:40 +02:00
helpers Moving the "Null" user object closer to User (#16070) 2022-01-12 08:45:01 -05:00
javascript Refactored client-side onboarding redirect logic. (#16026) 2022-01-11 07:04:06 -05:00
lib Small grammatical updates to the config constants (#16034) 2022-01-10 13:06:56 -07:00
liquid_tags Moving the "Null" user object closer to User (#16070) 2022-01-12 08:45:01 -05:00
mailers ✂✂✂ Remove Connect (#14734) 2021-11-18 08:21:00 -06:00
models Moving the "Null" user object closer to User (#16070) 2022-01-12 08:45:01 -05:00
policies small non-views ruby i18n (#16004) 2022-01-11 10:05:18 +07:00
queries small non-views ruby i18n (#16004) 2022-01-11 10:05:18 +07:00
refinements Drop profile columns from user (#10707) 2020-12-03 08:14:38 +07:00
sanitizers Extracting container for allowed tags & attrs (#15338) 2021-12-16 12:24:45 -05:00
serializers Extracting duplicate logic (#16035) 2022-01-10 15:19:04 -05:00
services Allow admin control of auth broadcast messages (was: Don't suggest apple authentication) (#16069) 2022-01-12 09:59:14 -06:00
uploaders small non-views ruby i18n (#16004) 2022-01-11 10:05:18 +07:00
validators Bump rubocop from 1.23.0 to 1.24.0 (#15872) 2021-12-27 10:04:59 -05:00
view_objects Upgrade to Ruby 3.0.2 (#12103) 2021-08-25 14:26:33 -04:00
views Use crayons_icon_tag for user and org views (#16014) 2022-01-11 10:10:21 +07:00
workers Add one day to the new users range (#16065) 2022-01-11 15:33:33 -06:00