Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid JWT: No re-login #173

Open
strarsis opened this issue Mar 6, 2022 · 4 comments
Open

Invalid JWT: No re-login #173

strarsis opened this issue Mar 6, 2022 · 4 comments

Comments

@strarsis
Copy link

strarsis commented Mar 6, 2022

When the FeathersJS app users table is changed and the app restarted (e.g. for development),
so the originally logged in user doesn't exist anymore, react-admin doesn't return to the login screen.
Instead it shows the error message/toast: Please login to continue.

The /authentication response (from FeathersJS): No record found [...].

@josx
Copy link
Owner

josx commented Mar 7, 2022

Maybe you can debug ra-data-feathers and check where to force to redirect to login in this case. Can you make on PR?
Check here https://github.com/josx/ra-data-feathers/blob/master/src/authClient.js

Anyway it is not an usual use case, because we already support reauthentication for other similar cases.

@strarsis
Copy link
Author

@josx: While further debugging this issue I notice that the same message Please login to continue also appears when the FeathersJS app isn't running at all (network error).

@josx
Copy link
Owner

josx commented Mar 14, 2022

Maybe you can debug a little more to realize if we can discriminate a network error or a login error, and how to do it.

@strarsis
Copy link
Author

strarsis commented Mar 18, 2022

@josx: Alright, the following is logged to JavaScript console when auth fails (FeathersJS restart / JWT invalid):

vendor.02334a7e.js:234 Uncaught (in promise) Error: Failed to fetch
    at fVe (vendor.02334a7e.js:234:59200)
    at Ml (vendor.02334a7e.js:234:59498)

The network tab shows a failed request to API, the response tab only shows an error:
Failed to load response data: No data found for resource with given identifier

The same with development builds (Error: Failed to fetch).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants