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
- COOKIE_NAME =
'BrickFTP'.freeze
Class Method Summary collapse
Class Method Details
.cookie(session) ⇒ Object
8 9 10 |
# File 'lib/brick_ftp/api/authentication.rb', line 8 def self.(session) CGI::Cookie.new(COOKIE_NAME, session.id) end |
.login(username, password) ⇒ Object
12 13 14 |
# File 'lib/brick_ftp/api/authentication.rb', line 12 def self.login(username, password) Session.create(username: username, password: password) end |
.logout ⇒ Object
16 17 18 |
# File 'lib/brick_ftp/api/authentication.rb', line 16 def self.logout BrickFTP.config.session.destroy end |