Module: BrickFTP::API::Authentication

Defined in:
lib/brick_ftp/api/authentication.rb,
lib/brick_ftp/api/authentication/session.rb

Defined Under Namespace

Classes: Session

Constant Summary collapse

'BrickAPI'.freeze

Class Method Summary collapse

Class Method Details

Generate authentication cookie.



11
12
13
# File 'lib/brick_ftp/api/authentication.rb', line 11

def self.cookie(session)
  CGI::Cookie.new(COOKIE_NAME, session.id)
end

.login(username, password) ⇒ Object

Alias for BrickFTP::API::Authentication::Session.create.



18
19
20
# File 'lib/brick_ftp/api/authentication.rb', line 18

def self.(username, password)
  Session.create(username: username, password: password)
end

.logout ⇒ Object

Alias for BrickFTP::API::Authentication::Session#destroy.



23
24
25
# File 'lib/brick_ftp/api/authentication.rb', line 23

def self.logout
  BrickFTP.config.session.destroy
end