docs icon indicating copy to clipboard operation
docs copied to clipboard

Avoid reloading the entire app when authenticating

Open Fab1en opened this issue 6 years ago • 1 comments

The window.location.replace('/'); line in admin/src/authProvider.js reloads the entire app when authentication is done. This is only necessary because the localStorage.getItem('token') is called once during Admin component startup and not every time a request is done. By moving this call inside fetchHydra, the token refresh is taken into account immediately, without needing a full app refresh.

Fab1en avatar May 06 '19 15:05 Fab1en

ping @mauchede

dunglas avatar May 06 '19 16:05 dunglas