Class: Remind101::Command::Auth

Inherits:
Base
  • Object
show all
Defined in:
lib/remind101/command/auth.rb

Overview

authentication (login, logout)

Instance Method Summary collapse

Instance Method Details

#indexObject

auth

Authenticate, display token and current user



10
11
12
13
14
# File 'lib/remind101/command/auth.rb', line 10

def index
  validate_arguments!

  Remind101::Command::Help.new.send(:help_for_command, current_command)
end

#loginObject

auth:login

log in with your remind101 credentials

Example:

$ remind101 auth:login Enter your Remind101 credentials: Email: [email protected] Password (typing will be hidden): Authentication successful.



28
29
30
31
32
33
# File 'lib/remind101/command/auth.rb', line 28

def 
  validate_arguments!

  Remind101::Auth.
  display "Authentication successful."
end

#logoutObject

auth:logout

clear local authentication credentials

Example:

$ remind101 auth:logout Local credentials cleared.



46
47
48
49
50
51
# File 'lib/remind101/command/auth.rb', line 46

def logout
  validate_arguments!

  Remind101::Auth.logout
  display "Local credentials cleared."
end

#tokenObject

auth:token

display your api token

Example:

$ remind101 auth:token ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCD



64
65
66
67
68
# File 'lib/remind101/command/auth.rb', line 64

def token
  validate_arguments!

  display Remind101::Auth.token
end

#whoamiObject

auth:whoami

display your remind101 email address

Example:

$ remind101 auth:whoami [email protected]



79
80
81
82
83
# File 'lib/remind101/command/auth.rb', line 79

def whoami
  validate_arguments!

  display Remind101::Auth.user
end