Add Personal Account
You can add a line to the Invitation accept method that creates the personal account.
I wasn't sure if that should be done by default or not. Probably should be if personal accounts are enabled.
I wanted to avoid confusion if they accept an invite and are then logged into the correct account. That should be doable if we set the account_id session cookie automatically after accepting.
I wasn't sure if that should be done by default or not. Probably should be if personal accounts are enabled.
I wanted to avoid confusion if they accept an invite and are then logged into the correct account. That should be doable if we set the account_id session cookie automatically after accepting.
I was doing the same thing as
Rustin Jessen
, and thought it would be easier to just comment out the following line? https://github.com/jumpstart-pro/jumpstart-pro/blob/master/app/controllers/users/registrations_controller.rb#L16
when doing this the personal account is created for users that get invited.
when doing this the personal account is created for users that get invited.
Been experimenting with this again. Checked out the path by ☒ and changed /app/controllers/users/registrations_controller.rb#L16 to
resource.skip_default_account = false
Now, with personal accounts turned on in config, a personal account is created for users accepting an invitation.
Now my only problem is that a personal account is not created for a user if the "Register with Account Details" setting is set to true. The form asks the user for an account name, and creates an account, but no personal account is created.
Is there a best practice to make sure a personal account is created for ALL new users, even if they are also creating another account?
Now my only problem is that a personal account is not created for a user if the "Register with Account Details" setting is set to true. The form asks the user for an account name, and creates an account, but no personal account is created.
Is there a best practice to make sure a personal account is created for ALL new users, even if they are also creating another account?
FWIW I got it.
Just commented out the following line
Just commented out the following line
#return accounts.first if accounts.any?
in app/models/concerns/user_accounts.rb:25
Now it creates a personal account whether the user is creating a new account with details (:name, :subdomain), or accepting an invitation to an account.
Notifications
You’re not receiving notifications from this thread.