This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/tests/acceptance
Martin Brennan 355d51afde
FEATURE: Allow using invites when DiscourseConnect SSO is enabled (#12419)
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
2021-03-19 10:20:10 +10:00
..
about-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
account-created-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
admin-badges-show-test.js UX: Add image uploader widget for uploading badge images (#12377) 2021-03-17 08:55:23 +03:00
admin-emails-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
admin-install-theme-modal-test.js FIX: Tests in admin/tests were not running (#12391) 2021-03-17 13:02:12 -04:00
admin-search-log-term-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
admin-search-logs-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
admin-site-settings-test.js FIX: force refresh staff action logs when transitioning from site settings (#12096) 2021-02-17 00:18:39 +05:30
admin-site-text-test.js UX: Text customization for different languages. (#11729) 2021-01-18 14:53:45 -03:00
admin-suspend-user-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
admin-user-badges-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
admin-user-emails-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
admin-user-index-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
admin-users-list-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
admin-watched-words-test.js Add watched words of type "replace" (#12020) 2021-02-25 14:00:58 +02:00
auth-complete-test.js UX: login; smaller titles, more consistent spacing, other fixes (#12317) 2021-03-09 17:00:46 -05:00
badges-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
bookmarks-test.js FIX: Do not allow bookmarks to use post date in past for reminder (#12138) 2021-02-19 13:57:27 +10:00
category-banner-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
category-chooser-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
category-edit-security-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
category-edit-test.js DEV: Sync up more Ember CLI features (#11790) 2021-01-21 15:55:39 -05:00
category-new-test.js UX: transition to edit URL when adding a category (#11634) 2021-01-05 08:34:35 -05:00
click-track-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
composer-actions-test.js DEV: {{user-selector}} replacement (#11726) 2021-02-01 13:07:11 +03:00
composer-attachment-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
composer-edit-conflict-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
composer-hyperlink-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
composer-onebox-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
composer-tags-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
composer-test.js DEV: {{user-selector}} replacement (#11726) 2021-02-01 13:07:11 +03:00
composer-topic-links-test.js UX: pasting a twitter link into composer title will not set the title (#12332) 2021-03-10 15:49:56 -05:00
composer-uncategorized-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
create-account-external-test.js UX: login; smaller titles, more consistent spacing, other fixes (#12317) 2021-03-09 17:00:46 -05:00
create-account-user-fields-test.js DEV: Sync up more Ember CLI features (#11790) 2021-01-21 15:55:39 -05:00
custom-html-set-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
custom-html-template-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
dashboard-test.js FEATURE: Add new features section in admin dashboard (#11731) 2021-01-22 10:09:02 -05:00
do-not-disturb-test.js FEATURE: Create notification schedule to automatically set do not disturb time (#11665) 2021-01-20 10:31:52 -06:00
email-notice-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
emoji-picker-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
emoji-test.js DEV: Remove JoyPixels emoji option (#12197) 2021-02-26 07:44:52 -05:00
encoded-category-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
enforce-second-factor-test.js DEV: Sync up more Ember CLI features (#11790) 2021-01-21 15:55:39 -05:00
flag-post-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
forgot-password-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
group-index-test.js DEV: Fix group-index-test under Ember CLI (#12153) 2021-02-22 15:27:01 +01:00
group-manage-categories-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
group-manage-interaction-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
group-manage-logs-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
group-manage-membership-test.js FEATURE: Improve group settings and members management (#11878) 2021-02-03 16:11:08 +02:00
group-manage-profile-test.js FEATURE: Improve group settings and members management (#11878) 2021-02-03 16:11:08 +02:00
group-manage-tags-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
group-requests-test.js UX: respect "prioritize username in ux" setting wherever possible (#12357) 2021-03-11 21:55:14 +05:30
group-test.js DEV: {{user-selector}} replacement (#11726) 2021-02-01 13:07:11 +03:00
groups-index-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
groups-new-test.js FIX: missing default notification level on group creation (#11512) 2020-12-16 15:52:34 -05:00
hamburger-menu-test.js DEV: prettier 2.2.1 (#11862) 2021-01-27 12:39:20 +01:00
hashtags-test.js FIX: Make category slugs lowercase (#11277) 2021-01-12 17:28:33 +02:00
invite-accept-test.js FEATURE: Allow using invites when DiscourseConnect SSO is enabled (#12419) 2021-03-19 10:20:10 +10:00
invite-show-user-fields-test.js DEV: Sync up more Ember CLI features (#11790) 2021-01-21 15:55:39 -05:00
jump-to-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
keyboard-shortcuts-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
login-redirect-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
login-required-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
login-with-email-and-hide-email-address-taken-test.js UX: add link for email login below username, remove button (#12118) 2021-02-24 16:30:08 -05:00
login-with-email-and-no-social-logins-test.js UX: add link for email login below username, remove button (#12118) 2021-02-24 16:30:08 -05:00
login-with-email-disabled-test.js UX: add link for email login below username, remove button (#12118) 2021-02-24 16:30:08 -05:00
login-with-email-test.js UX: add link for email login below username, remove button (#12118) 2021-02-24 16:30:08 -05:00
mobile-discovery-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
mobile-sign-in-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
mobile-users-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
modal-test.js FIX: Clean up topic-timer-info CSS classes, add edit button, and improve UI (#12080) 2021-02-16 12:07:30 +10:00
new-message-test.js DEV: {{user-selector}} replacement (#11726) 2021-02-01 13:07:11 +03:00
new-topic-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
notifications-filter-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
opengraph-tag-updater-test.js FIX: Safari iOS page title and url regression when sharing (#11699) 2021-01-13 11:10:43 -05:00
page-publishing-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
password-reset-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
personal-message-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
plugin-keyboard-shortcut-test.js DEV: Sync up more Ember CLI features (#11790) 2021-01-21 15:55:39 -05:00
plugin-outlet-connector-class-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
plugin-outlet-decorator-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
plugin-outlet-multi-template-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
plugin-outlet-single-template-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
post-admin-menu-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
preferences-test.js FEATURE: Move security related user preferences to different tab (#12264) 2021-03-03 11:09:22 +02:00
raw-plugin-outlet-test.js DEV: Sync up more Ember CLI features (#11790) 2021-01-21 15:55:39 -05:00
redirect-to-top-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
reports-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
review-test.js UX: Clarify user rejection modal (#11967) 2021-02-04 15:20:07 -05:00
search-full-test.js A11Y: associate search controls with their labels (#11806) 2021-01-21 22:24:15 -05:00
search-mobile-test.js FIX: Show all topic statuses on full page search. 2020-12-23 10:30:35 +08:00
search-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
share-and-invite-desktop-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
share-and-invite-mobile-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
shared-drafts-test.js FIX: Make category change work with shared drafts (#11705) 2021-01-14 19:20:34 +02:00
sign-in-test.js DEV: Sync up more Ember CLI features (#11790) 2021-01-21 15:55:39 -05:00
static-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
tag-groups-test.js DEV: Migrate more tests to our Ember CLI format. (#11899) 2021-02-01 09:01:47 -05:00
tags-intersection-test.js FEATURE: Always show tag dropdown when tagging is enabled (#12209) 2021-03-10 21:13:15 -05:00
tags-test.js UX: don't display tag notification menu on category page. (#11989) 2021-02-05 09:19:00 +05:30
topic-admin-menu-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
topic-anonymous-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
topic-discovery-test.js DEV: Sync up more Ember CLI features (#11790) 2021-01-21 15:55:39 -05:00
topic-edit-timer-test.js FIX: Clean up topic-timer-info CSS classes, add edit button, and improve UI (#12080) 2021-02-16 12:07:30 +10:00
topic-footer-buttons-mobile-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
topic-list-tracker-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
topic-move-posts-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
topic-notifications-button-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
topic-quote-button-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
topic-test.js FIX: all staff members (regardless of TL) should be able to pin/unpin topics (#12435) 2021-03-18 15:32:42 -04:00
unknown-test.js FIX: Stop category 404s from breaking the router (#11424) 2020-12-07 14:22:39 -08:00
user-anonymous-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
user-bookmarks-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
user-card-test.js DEV: Sync up more Ember CLI features (#11790) 2021-01-21 15:55:39 -05:00
user-drafts-stream-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
user-preferences-interface-test.js DEV: Fix settings/interface UI breaking on Ember CLI (#12154) 2021-02-24 16:14:06 +01:00
user-preferences-notifications-test.js FEATURE: Create notification schedule to automatically set do not disturb time (#11665) 2021-01-20 10:31:52 -06:00
user-test.js DEV: Sync up more Ember CLI features (#11790) 2021-01-21 15:55:39 -05:00
users-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00