access-token

Where to store access-token in react.js?

你离开我真会死。 提交于 2020-08-21 02:54:55
问题 I am building an app in Reactjs. I have to make fetch call, after verifying the access_token. On signup, access_token are acquired from back-end server. But, where to store these access_token. Is there any way of making these access_token global, so that all component can access it. I have used local storage, cache and session storage, but those are not advisable. Held up in this issue for past few days, any solutions for it. Thnks in advance. 回答1: Available options and limitations: There are

Where to store access-token in react.js?

自作多情 提交于 2020-08-21 02:53:05
问题 I am building an app in Reactjs. I have to make fetch call, after verifying the access_token. On signup, access_token are acquired from back-end server. But, where to store these access_token. Is there any way of making these access_token global, so that all component can access it. I have used local storage, cache and session storage, but those are not advisable. Held up in this issue for past few days, any solutions for it. Thnks in advance. 回答1: Available options and limitations: There are