admin-on-rest
admin-on-rest copied to clipboard
'Not found' when logging out
Porting issue #1644 from react-admin, initially reported by asliwinski
What you were expecting: To be redirected to login page without errors after pressing Logout button
What happened instead:
'Not found' appears for a fraction of second before the redirection, as soon as the promise from authClient
is returned.
Steps to reproduce:
- Clone and install the minimal example app (it's just a few steps of the tutorial + the basic
authClient
) - Replace the
node_modules/admin-on-rest/lib/sideEffect/saga/auth.js
with theauth.js
fromsrc
of the repo (2 breakpoints added to catch the error):
case USER_LOGOUT: {
debugger;
yield call(authClient, AUTH_LOGOUT);
debugger;
yield put(push('/login'));
break;
}
- run the app, open the console and log out. When it hits the first breakpoint resume script execution to see the error. (Just when I'm testing it right now it went OK at the first attempt and failed at second, which suggests some kind of a race condition).
Before:
After:
Environment
- Admin-on-rest version: 1.4.0
- React version: 16.2.0