Add db/user seeds

This commit is contained in:
Râu Cao
2022-12-07 18:12:54 +01:00
parent 20382f7df7
commit 4cb7c0998f
5 changed files with 33 additions and 7 deletions

View File

@@ -37,6 +37,7 @@ class CreateAccount < ApplicationService
end
# TODO move to confirmation
# (and/or add email_confirmed to entry and use in login filter)
def add_ldap_document
hashed_pw = Devise.ldap_auth_password_builder.call(@password)
CreateLdapUserJob.perform_later(@username, @domain, @email, hashed_pw)
@@ -49,6 +50,8 @@ class CreateAccount < ApplicationService
end
def create_lndhub_wallet(user)
#TODO enable in development when we have a local lndhub (mock?) API
return if Rails.env.development?
CreateLndhubWalletJob.perform_later(user)
end
end

View File

@@ -10,6 +10,10 @@ class LdapService < ApplicationService
res
end
def add_attribute(dn, attr, value)
ldap_client.add_attribute dn, attr, value
end
def delete_entry(dn, interactive=false)
puts "Deleting entry: #{dn}" if interactive
res = ldap_client.delete dn: dn