Method: Kno::API#authenticate

Defined in:
lib/kno.rb

#authenticate(kno_token) ⇒ Object



53
54
55
56
57
58
59
60
61
62
# File 'lib/kno.rb', line 53

def authenticate(kno_token)
  params = {token: kno_token}
  resp = Faraday.post(@authenticate_url, params.to_json(), @headers)
  if resp.status == 200
    persona_id = JSON.parse(resp.body)['persona']['id']
  else
    raise ArgumentError
  end

end