TheDJVG / SimplyGoPy

Python 3 module to talk to SimplyGo from Transit Link in Singapore
MIT License
6 stars 2 forks source link

Authentication fails due to invalid session key #1

Open nondescryptid opened 2 years ago

nondescryptid commented 2 years ago

Hi DJVG,

Thanks for making this package! Just wanted to check if this is an issue that exists for other users too. I'm currently trying to make something to help me add up all transactions from a given date range.

Issue: Cannot retrieve user info even though login credentials are correct

Screenshot 2022-09-27 at 8 06 03 PM

I have excluded incorrect credentials as a possible cause as I logged in on the SimplyGo website with the same credentials successfully.

How would one go about debugging this? Apologies as I'm not familiar with how this package works.

TheDJVG commented 9 months ago

Hi nondescryptid,

Are you still looking to use this package? I've neglected it a bit (and didn't see this issue, oops) as it didn't fully fit my own use case anymore.

However, with the growing usage and interest in Singapore regarding SimplyGO I'm willing to pick it up again and see if can still work.

Thanks, Daan

wfxronald commented 9 months ago

I have just recently used this library and I could confirm that this issue is reproducible.

Strangely, I noted that my first attempt to login using the credentials is successful. Also realised that my SimplyGo app on my phone is automatically logged out after login from Python using this library.

I logged into the SimplyGo app on my phone again, and now when I login from Python, I will encounter the invalid session key error. I suspect there is some limitation with regards to concurrent login for SimplyGo, but I guess the maintainer would know this better.

EDIT: removing the session file from /tmp/simplygo.session seems to solve the issue

TheDJVG commented 9 months ago

Thanks for the feedback!

I think only a single session can be active at a given time. That would explain the error, but I think I added a session validation.

I will push some changes to handle the session and the location of the session file.