ThoreBor / Anki_Leaderboard

Anki 2.1 Add-On
https://ankiweb.net/shared/info/41708974
MIT License
49 stars 11 forks source link

[Feature request] Support multiple logged-in clients for one account #235

Open Liftyee opened 3 months ago

Liftyee commented 3 months ago

WIth the way the authentication system currently works, there can only ever be one logged in session for a user. When I log in to the leaderboard on another computer, I am logged out on the original machine. This means I have to log in repeatedly when I switch between laptop and desktop, even though Anki can sync between them.

Ideally I would like multiple logged in sessions to be supported. After studying the code I think this could be done by either supporting multiple session tokens per account, or just returning the existing session token (instead of generating a new one) if you log in on a second device. The tokens would need to have an expiry date for this to work securely.

I'm reasonably fluent in Python, so I'll try to implement the changes myself and make a PR at some point in the future.