diff --git a/app/assets/javascripts/discourse/app/controllers/invites-show.js b/app/assets/javascripts/discourse/app/controllers/invites-show.js index 875820daf77..0e640be3949 100644 --- a/app/assets/javascripts/discourse/app/controllers/invites-show.js +++ b/app/assets/javascripts/discourse/app/controllers/invites-show.js @@ -63,6 +63,11 @@ export default Controller.extend( this.setProperties(props); }, + @discourseComputed + discourseConnectEnabled() { + return this.siteSettings.enable_discourse_connect; + }, + @discourseComputed welcomeTitle() { return I18n.t("invites.welcome_to", { @@ -83,10 +88,17 @@ export default Controller.extend( @discourseComputed externalAuthsOnly() { return ( - !this.siteSettings.enable_local_logins && this.externalAuthsEnabled + !this.siteSettings.enable_local_logins && + this.externalAuthsEnabled && + !this.siteSettings.enable_discourse_connect ); }, + @discourseComputed("externalAuthsOnly", "discourseConnectEnabled") + showSocialLoginAvailable(externalAuthsOnly, discourseConnectEnabled) { + return !externalAuthsOnly && !discourseConnectEnabled; + }, + @discourseComputed( "externalAuthsOnly", "authOptions", @@ -170,6 +182,9 @@ export default Controller.extend( @discourseComputed wavingHandURL: () => wavingHandURL(), + @discourseComputed + ssoPath: () => getUrl("/session/sso"), + actions: { submit() { const userFields = this.userFields; diff --git a/app/assets/javascripts/discourse/app/templates/invites/show.hbs b/app/assets/javascripts/discourse/app/templates/invites/show.hbs index d4a0f5afc9e..9a45776efa2 100644 --- a/app/assets/javascripts/discourse/app/templates/invites/show.hbs +++ b/app/assets/javascripts/discourse/app/templates/invites/show.hbs @@ -21,15 +21,16 @@
{{user-info user=invitedBy}}
{{#unless isInviteLink}} -+
{{/unless}} {{#if externalAuthsOnly}} + {{! authOptions are present once the user has followed the OmniAuth flow (e.g. twitter/google/etc) }} {{#if authOptions}} {{#unless isInviteLink}} {{input-tip validation=emailValidation id="account-email-validation"}} @@ -39,6 +40,12 @@ {{/if}} {{/if}} + {{#if discourseConnectEnabled}} + + {{i18n "continue"}} + + {{/if}} + {{#if shouldDisplayForm}}