ra-data-feathers icon indicating copy to clipboard operation
ra-data-feathers copied to clipboard

Invalid JWT: No re-login

Open strarsis opened this issue 2 years ago • 4 comments

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 [...].

strarsis avatar Mar 06 '22 17:03 strarsis

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.

josx avatar Mar 07 '22 13:03 josx

@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).

strarsis avatar Mar 11 '22 20:03 strarsis

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.

josx avatar Mar 14 '22 12:03 josx

@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).

strarsis avatar Mar 18 '22 20:03 strarsis