You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
505 B

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
def call(user, username)
user.account.username = username
user.account.domain = nil
keypair =
user.account.private_key = keypair.to_pem
user.account.public_key = keypair.public_key.to_pem!