Skip to content
This repository was archived by the owner on Sep 24, 2018. It is now read-only.

'Not found' when logging out #1

@fzaninotto

Description

@fzaninotto

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 the auth.js from src 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:

image

After:

image

Environment

  • Admin-on-rest version: 1.4.0
  • React version: 16.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions