diff --git a/.gitignore b/.gitignore index 1c8547f0..a2221596 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,9 @@ # Ignore vs code config. .vscode +# Ignore all .DS_Store files. +**/.DS_Store + # Ignore bundler config. /.bundle diff --git a/app/controllers/o_auths_controller.rb b/app/controllers/o_auths_controller.rb index 3a618271..678bc53a 100644 --- a/app/controllers/o_auths_controller.rb +++ b/app/controllers/o_auths_controller.rb @@ -2,6 +2,7 @@ class OAuthsController < ApplicationController include HTTParty include OAuthsHelper include ApplicationHelper + include Devise::Controllers::Rememberable before_action :authenticate_admin, only: [:index, :create, :update, :destroy] @@ -124,6 +125,7 @@ class OAuthsController < ApplicationController if user.oauth_token == params[:token] sign_in user + remember_me user user.invalidate_oauth_token flash[:notice] = I18n.t('devise.sessions.signed_in') redirect_to root_path diff --git a/app/controllers/tenants_controller.rb b/app/controllers/tenants_controller.rb index 71eff183..3d499eb0 100644 --- a/app/controllers/tenants_controller.rb +++ b/app/controllers/tenants_controller.rb @@ -46,9 +46,6 @@ class TenantsController < ApplicationController @user.save! CreateWelcomeEntitiesWorkflow.new().run - OAuth.include_only_defaults.each do |o_auth| - TenantDefaultOAuth.create(o_auth_id: o_auth.id) - end logger.info { "New tenant registration: #{Current.tenant.inspect}" } diff --git a/app/javascript/components/SiteSettings/Authentication/OAuthProviderItem.tsx b/app/javascript/components/SiteSettings/Authentication/OAuthProviderItem.tsx index 99d20c78..ac39827f 100644 --- a/app/javascript/components/SiteSettings/Authentication/OAuthProviderItem.tsx +++ b/app/javascript/components/SiteSettings/Authentication/OAuthProviderItem.tsx @@ -28,7 +28,12 @@ const OAuthProviderItem = ({ }: Props) => (
  • - + { + oAuth.logo && oAuth.logo.length > 0 ? + + : +
    + }
    {oAuth.name} diff --git a/app/javascript/components/TenantSignUp/TenantSignUpP.tsx b/app/javascript/components/TenantSignUp/TenantSignUpP.tsx index 96a9c3f6..d5289f55 100644 --- a/app/javascript/components/TenantSignUp/TenantSignUpP.tsx +++ b/app/javascript/components/TenantSignUp/TenantSignUpP.tsx @@ -91,7 +91,7 @@ const TenantSignUpP = ({ if (authMethod == 'oauth') { let redirectUrl = new URL(baseUrl); redirectUrl.hostname = `${subdomain}.${redirectUrl.hostname}`; - window.location.href = `${redirectUrl.toString()}users/sign_in`; + window.location.href = redirectUrl.toString(); return; } diff --git a/app/javascript/components/common/OAuthProviderLink.tsx b/app/javascript/components/common/OAuthProviderLink.tsx index 61c39803..bef01945 100644 --- a/app/javascript/components/common/OAuthProviderLink.tsx +++ b/app/javascript/components/common/OAuthProviderLink.tsx @@ -14,7 +14,7 @@ const OAuthProviderLink = ({ oAuthId, oAuthName, oAuthLogo, oAuthReason, isSignU onClick={() => window.location.href = `/o_auths/${oAuthId}/start?reason=${oAuthReason}`} className={`oauthProviderBtn oauthProvider${oAuthName.replace(' ', '')}`} > - {oAuthName} + { oAuthLogo && oAuthLogo.length > 0 && {oAuthName} } { isSignUp ? diff --git a/app/workflows/create_welcome_entities_workflow.rb b/app/workflows/create_welcome_entities_workflow.rb index 305c3f24..3afe0ca1 100644 --- a/app/workflows/create_welcome_entities_workflow.rb +++ b/app/workflows/create_welcome_entities_workflow.rb @@ -67,5 +67,13 @@ class CreateWelcomeEntitiesWorkflow body: 'Users can comment to express their opinions! As with posts and board descriptions, comments can be *Markdown* **formatted**', user_id: owner.id ) + + # Set first board as root page + TenantSetting.create!(root_board_id: feature_board.id) + + # Enable all default oauths + OAuth.include_only_defaults.each do |o_auth| + TenantDefaultOAuth.create!(o_auth_id: o_auth.id) + end end end \ No newline at end of file