timdorr / tesla-api

🚘 A Ruby gem and unofficial documentation of Tesla's JSON API for the Model S, 3, X, and Y.
https://tesla-api.timdorr.com/
MIT License
1.98k stars 532 forks source link

in `login!': undefined method `split' for nil:NilClass (NoMethodError) #722

Closed lemeo closed 1 year ago

lemeo commented 1 year ago

Discussed in https://github.com/timdorr/tesla-api/discussions/523

Hey @timdorr, I got the same issue. You already updated this ruby lib with the new SSO authentication way. https://github.com/timdorr/tesla-api/blob/5e23c3bf856b62a6eb931d4cae717516186bb7b7/lib/tesla_api/client.rb#L61-L146

Based on your update, from my understanding, the step to authenticate is as follows: Step 1:

tesla_api = TeslaApi::Client.new(email: "tesla account email", client_id: nil, client_secret: nil)

We do not need to set client_id and client_secret since it is deprecated, and we have the default client_id set as ownerapi within login!(password) function.
Step 2:

tesla_api.login!('tesla account email')

Why do I get this error?

NoMethodError: undefined method `split' for nil:NilClass

Do we need to update the ruby lib? Or let me know the latest way to use this Ruby lib to authenticate. Thank you!

lemeo commented 1 year ago

Similar to this closed issue: https://github.com/timdorr/tesla-api/issues/704

timdorr commented 1 year ago

This is the same as #431, so I'm closing this out to focus discussion there.