Add dotenv

This commit is contained in:
2020-11-09 09:54:26 +01:00
parent 259856a033
commit 6d59938e0d
5 changed files with 20 additions and 3 deletions

View File

@@ -24,9 +24,9 @@ class LdapUsersController < ApplicationController
private
def ldap_client
ldap_client ||= Net::LDAP.new host: "ldap.kosmos.org",
port: 636,
encryption: :simple_tls,
ldap_client ||= Net::LDAP.new host: ENV['LDAP_HOST'],
port: ENV['LDAP_PORT'],
encryption: ENV['LDAP_USE_TLS'] ? :simple_tls : nil,
auth: {
method: :simple,
username: Rails.application.credentials.ldap[:username],