Method: Clever::Client#authenticate

Defined in:
lib/clever/client.rb

#authenticate(app_id = @app_id) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/clever/client.rb', line 21

def authenticate(app_id = @app_id)
  return if @app_token

  response = tokens

  fail ConnectionError, response.raw_body unless response.success?

  set_token(response, app_id)
end