Module: RocketChat::Realtime::Methods::Auth
- Included in:
- Client
- Defined in:
- lib/rocket_chat/realtime/methods/auth.rb
Overview
Auth methods
Instance Method Summary collapse
-
#login(username, password) ⇒ Object
Login into server.
Instance Method Details
#login(username, password) ⇒ Object
Login into server
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/rocket_chat/realtime/methods/auth.rb', line 20 def login(username, password) method = Messages::Method.new( 'login', user: { username: username }, password: { algorithm: 'sha-256', digest: Digest::SHA256.hexdigest(password) } ) AsyncTask.start(method.id) do driver.text(method.to_json) end end |