DeutscheModelUnitedNations / munify-delegator

DELEGATOR registration app, part of MUN-Product Suite MUNify
GNU Affero General Public License v3.0
4 stars 3 forks source link

🐞 fix: prevent failure & add error messages on failed refresh attempts #109

Closed m1212e closed 1 month ago

m1212e commented 1 month ago

Describe your PR <3

m1212e commented 1 month ago

@TadeSF In the current implementation, when a token set is found but the access token is expired, the app will try to refresh it. If that failed too, the request will be rejected with a forbidden status, just as if you were not logged in properly. A page reload will then trigger a new login flow. I did not include an automatic redirect to the / path since this might lead to loss of data in e.g. forms which might not be saved/submitted yet. We could discuss a custom error message which suggests reloading the page to get a fresh login flow & a corresponding session. Whats your take on this?

Strehk commented 1 month ago

@m1212e thanks! Sounds good. A popup modal that suggests updating the data seems like the best solution to me as well. But the initial flow remains untouchted on actual sign up, do I understand that correctly?

github-actions[bot] commented 1 month ago

🥷 Ninja i18n – 🛎️ Translations need to be updated

Project /project.inlang

lint rule new reports level link
Missing translation 4 warning contribute (via Fink 🐦)
m1212e commented 1 month ago

Yes the flow stays the same for the user.

m1212e commented 1 month ago

Basically now they just get a proper error toast which asks them to reload the page which will trigger a fresh login flow instead of doing nothing and having the api respond with some error code