Class: ShopifyCli::Commands::Logout

Inherits:
ShopifyCli::Command show all
Defined in:
lib/shopify-cli/commands/logout.rb

Constant Summary collapse

LOGIN_TOKENS =
[
  :identity_access_token, :identity_refresh_token, :identity_exchange_token,
  :admin_access_token, :admin_refresh_token, :admin_exchange_token
]

Instance Attribute Summary

Attributes inherited from ShopifyCli::Command

#ctx, #options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ShopifyCli::Command

call, call_help, #initialize, options, prerequisite_task, run_prerequisites, subcommand, subcommand_registry

Methods included from Feature::Set

#hidden?, #hidden_feature

Constructor Details

This class inherits a constructor from ShopifyCli::Command

Class Method Details

.helpObject



18
19
20
# File 'lib/shopify-cli/commands/logout.rb', line 18

def self.help
  ShopifyCli::Context.message('core.logout.help', ShopifyCli::TOOL_NAME)
end

Instance Method Details

#callObject



11
12
13
14
15
16
# File 'lib/shopify-cli/commands/logout.rb', line 11

def call(*)
  .each do |token|
    ShopifyCli::DB.del(token) if ShopifyCli::DB.exists?(token)
  end
  @ctx.puts(@ctx.message('core.logout.success'))
end