evcc-io / evcc

Solar Charging ☀️🚘
https://evcc.io
MIT License
3.63k stars 674 forks source link

Polestar: Change authentication flow to deny cookies #17276

Closed loebse closed 6 days ago

loebse commented 1 week ago

Fix https://github.com/evcc-io/evcc/issues/17186

I took the liberty to create a PR to implement the changes discussed in https://github.com/evcc-io/evcc/issues/17186 and https://github.com/evcc-io/evcc/pull/17252 to speed up the process 😉

Main change is to check for the uid and then deny the cookies using confirmConsentAndGetCode

I was able to successfully test this with my Polestar 2

loebse commented 1 week ago

@rostbeule / @scyomantion / @andig

As mentioned above, I was able to make it run with the following code. Please let me know what you think!

rostbeule commented 1 week ago

Nice, I had the same thought earlier. You're capturing both values before and avoid passing param into the function directly. That would have caused issues in my case. I like this approach.

In my view, my PR is obsolete then. I did mention somewhere that I wouldn't have time for it until Sunday. The sun isn't shining anyway =D

andig commented 6 days ago

I've lost track. Does this now work as-is?

loebse commented 6 days ago

Thanks for your comments @andig I have incorporated the changes and verified it is working fine with my P2.

andig commented 6 days ago

Great, thank you!