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 =
'BrickAPI'.freeze
Class Method Summary collapse
-
.cookie(session) ⇒ CGI::Cookie
Generate authentication cookie.
-
.login(username, password) ⇒ Object
Alias for ‘BrickFTP::API::Authentication::Session.create`.
-
.logout ⇒ Object
Alias for ‘BrickFTP::API::Authentication::Session#destroy`.
Class Method Details
.cookie(session) ⇒ CGI::Cookie
Generate authentication cookie.
11 12 13 |
# File 'lib/brick_ftp/api/authentication.rb', line 11 def self.(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.login(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 |