akkounts/app/jobs/create_lndhub_account_job.rb
Râu Cao 51952ecdc2
All checks were successful
continuous-integration/drone/push Build is passing
Add migration for unencrypted ln login field
2023-01-11 19:50:01 +08:00

15 lines
427 B
Ruby

class CreateLndhubAccountJob < ApplicationJob
queue_as :default
def perform(user)
return if user.ln_login.present? && user.ln_password.present?
lndhub = LndhubV2.new
credentials = lndhub.create_account
user.update! ln_account: credentials["login"],
ln_login: credentials["login"], # TODO remove when production is migrated
ln_password: credentials["password"]
end
end