mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 06:49:14 +08:00
355d51afde
This PR allows invitations to be used when the DiscourseConnect SSO is enabled for a site (`enable_discourse_connect`) and local logins are disabled. Previously invites could not be accepted with SSO enabled simply because we did not have the code paths to handle that logic. The invitation methods that are supported include: * Inviting people to groups via email address * Inviting people to topics via email address * Using invitation links generated by the Invite Users UI in the /my/invited/pending route The flow works like this: 1. User visits an invite URL 2. The normal invitation validations (redemptions/expiry) happen at that point 3. We store the invite key in a secure session 4. The user clicks "Accept Invitation and Continue" (see below) 5. The user is redirected to /session/sso then to the SSO provider URL then back to /session/sso_login 6. We retrieve the invite based on the invite key in secure session. We revalidate the invitation. We show an error to the user if it is not valid. An additional check here for invites with an email specified is to check the SSO email matches the invite email 7. If the invite is OK we create the user via the normal SSO methods 8. We redeem the invite and activate the user. We clear the invite key in secure session. 9. If the invite had a topic we redirect the user there, otherwise we redirect to / Note that we decided for SSO-based invites the `must_approve_users` site setting is ignored, because the invite is a form of pre-approval, and because regular non-staff users cannot send out email invites or generally invite to the forum in this case. Also deletes some group invite checks as per https://github.com/discourse/discourse/pull/12353 |
||
---|---|---|
.. | ||
versioning | ||
concurrency.rb | ||
diagnostics_helper.rb | ||
discourse_event_helper.rb | ||
fake_logger.rb | ||
helpers.rb | ||
integration_helpers.rb | ||
match_html_matcher.rb | ||
rate_limit_matcher.rb | ||
shared_examples_for_stats_cacheable.rb | ||
sidekiq_helpers.rb | ||
site_settings_helpers.rb | ||
time_matcher.rb | ||
uploads_helpers.rb | ||
webauthn_integration_helpers.rb |