CoderDojo / community-platform

Zen, the CoderDojo Community Platform!
https://zen.coderdojo.com
MIT License
121 stars 55 forks source link

Race condition in redirection between Angular1 and VueJs #1255

Closed Wardormeur closed 5 years ago

Wardormeur commented 5 years ago

When hitting /start-dojo, it gets redirected to /dashboard/start-dojo. When the user is un-authenticated, the /dashboard will redirect to /login with the proper referer. However, /login is on a different stack, namely VueJs. A reload is necessary in order to load the proper front-end files. To do so, we call window.location.reload(). The issue lies in the redirection happening in parallel to the /dashboard/start-dojo redirection. The redirection seems to be non-deterministic, hence the definition of race condition between each redirection, from /dashboard to /login.