Feathers: RESTCLIENT can call FIND but not by REACT CODE

Created on 13 May 2020  路  4Comments  路  Source: feathersjs/feathers

Steps to reproduce

(First please check that this issue is not already solved as described
here
)
FEATHER CLIENT IMPORT
221

PROBLEM IN CODE
222

EASY RETURN IN POSTMAN
gh

Expected behavior

should return data in users

Actual behavior

Tell us what happens instead
Capture

System configuration

windows , 16gb ram

Tell us about the applicable parts of your setup.

Module versions (especially the part that's not working): 4.5.4

NodeJS version: Latest

Operating System: Windows

Browser Version: Latest

React Native Version:not use

Module Loader: npm

Most helpful comment

Just having the token in storage is not enough. You have to call reAuthenticate every time your page loads for the client to use it.

All 4 comments

Did you authenticate with the feathers client before making the request?
And I don't know if freezing your feathers class is a good idea, as the feathers client handle its state internally.

Did you authenticate with the feathers client before making the request?
And I don't if freezing your feathers class is a good idea, as the feathers client handle its state internally.

ok i will change freezing .. and i think the client object it is already authenticate and i can use client.service("users").find() and i authenticate it with client.authenticate function where i pass username and password and in my localhost i can see jwt-token in storing

Just having the token in storage is not enough. You have to call reAuthenticate every time your page loads for the client to use it.

Just having the token in storage is not enough. You have to call reAuthenticate every time your page loads for the client to use it.

thanks for the reply @daffl , now i understand i have to reAuthenticate that token but i cannot under where exactly i have to do it in my code .. when i reload the page again my feather.js loads and again new client object created .. i cannot see the example where developer use reAuthenticate property on reload the page .. i study the chat-app of react app feather application where i cannot find reAuthenticate and when i refresh my page then same screen come without reauthentication.

It is very nice if i found an example where developer use react-router and reauthentication manage there

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rstegg picture rstegg  路  3Comments

NetOperatorWibby picture NetOperatorWibby  路  4Comments

codeus-de picture codeus-de  路  4Comments

stephane303 picture stephane303  路  3Comments

eric-burel picture eric-burel  路  3Comments