Add some welcome entities on tenant signup (#266)

This commit is contained in:
Riccardo Graziosi
2024-01-24 18:37:54 +01:00
committed by GitHub
parent d80f63f27f
commit 30b7b0f5f4
13 changed files with 90 additions and 77 deletions

View File

@@ -40,14 +40,14 @@ class OAuthsController < ApplicationController
Current.tenant = Tenant.find_by(subdomain: tenant_domain)
end
user_profile = OAuthExchangeAuthCodeForProfile.new(
user_profile = OAuthExchangeAuthCodeForProfileWorkflow.new(
authorization_code: params[:code],
o_auth: @o_auth
).run
if reason == 'login'
user = OAuthSignInUser.new(
user = OAuthSignInUserWorkflow.new(
user_profile: user_profile,
o_auth: @o_auth
).run

View File

@@ -45,6 +45,8 @@ class TenantsController < ApplicationController
@user.save!
CreateWelcomeEntitiesWorkflow.new().run
render json: @tenant, status: :created
rescue ActiveRecord::RecordInvalid => exception