Skip to content

Commit

Permalink
Fixed save credential from cli
Browse files Browse the repository at this point in the history
  • Loading branch information
CognitiveDisson committed Mar 23, 2018
1 parent caf445b commit 0cf3bf8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions lib/fabricio.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
require 'fabricio/version'
require 'fabricio/client/client'
require 'fabricio/models/credential'
require 'fabricio/authorization/file_session_storage'
require 'fabricio/authorization/file_param_storage'
require 'fabricio/authorization/memory_session_storage'
require 'fabricio/authorization/memory_param_storage'
6 changes: 3 additions & 3 deletions lib/fabricio/cli/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ def credential
tmp_client = Fabricio::Client.new do |config|
config.username = credential.email
config.password = credential.password
config.session_storage = FileSessionStorage()
config.session_storage = Fabricio::Authorization::FileSessionStorage.new()
end

say("Your session store in #{SESSION_FILE_PATH}")

organization = tmp_client.organization.get
unless organization.nil?
organization = tmp_client.organization.all
unless organization.any?
say("Successful login")
else
say("Login failed")
Expand Down

0 comments on commit 0cf3bf8

Please sign in to comment.