13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/auth.rb', line 13
def load_config
path = self.config
tmpA = AuthHandler.new
puts path
if path && File.exists?(path)
content = File.read(path)
tmpA = AuthHandler.new(JSON.load(content))
end
if tmpA.token && tmpA.token != "" && self.token.nil? && self.username.nil?
self.token = tmpA.token
elsif tmpA.username && tmpA.username != "" && self.username.nil?
self.username = tmpA.username
elsif tmpA.password && tmpA.password != "" && self.password.nil?
self.password = tmpA.password
end
if tmpA.tfa && self.tfa == ""
self.tfa = tmpA.tfa
end
return nil
end
|