mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-13 03:58:59 +00:00
27 lines
674 B
Ruby
27 lines
674 B
Ruby
class OrganizationUsersController < ApplicationController
|
|
|
|
def create
|
|
|
|
first_name = params[:first_name]
|
|
last_name = params[:last_name]
|
|
email = params[:email]
|
|
role = params[:role]
|
|
password = SecureRandom.uuid
|
|
org = @current_user.organization
|
|
|
|
user = User.create(
|
|
first_name: first_name,
|
|
last_name: last_name,
|
|
email: email,
|
|
password: password,
|
|
password_confirmation: password,
|
|
organization: org
|
|
)
|
|
|
|
OrganizationUser.create(
|
|
role: role,
|
|
user: user,
|
|
organization: org
|
|
)
|
|
end
|
|
end
|