This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2016-02-24 03:57:29 -08:00
|
|
|
class SetupLocalAccountService < BaseService
|
|
|
|
# Setup an account for a new user instance by generating
|
|
|
|
# an RSA key pair and a profile
|
|
|
|
# @param [User] user Unsaved user instance
|
|
|
|
# @param [String] username
|
2016-02-22 07:00:20 -08:00
|
|
|
def call(user, username)
|
|
|
|
user.build_account
|
|
|
|
|
|
|
|
user.account.username = username
|
|
|
|
user.account.domain = nil
|
|
|
|
|
|
|
|
user.save!
|
|
|
|
end
|
|
|
|
end
|