Kyoso-Team / kyoso

A web application that takes osu! tournaments beyonds spreadsheets.
http://kyoso.sh
GNU Affero General Public License v3.0
1 stars 1 forks source link

Better user experience upon failure of authentication #9

Closed TTTaevas closed 1 year ago

TTTaevas commented 1 year ago

Long story short, you can get stuck on error screens as long as you have a session cookie if the website attempts to refresh your data with an invalid or expired refresh token You would also get stuck if you somehow had an invalid session cookie This PR changes some authorization logic, and makes use of some try catch statements as failure is expected to happen

Mainly, upon login, the website'll send the user to the Discord auth prompt page if the refresh token didn't work (case that should've been handled by #4 but was not noticed) At any point, your current session cookie will be revoked if it is not valid It'll also be revoked if the website is not capable of refreshing your data

I doubt there's a flaw in all that logic, and I've tested the code as much as I could, but I really wouldn't mind someone checking if everything is alright