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

How to create relay environment with token retreived from store #170

Open
varun-pushpan opened this issue Apr 19, 2021 · 0 comments
Open

Comments

@varun-pushpan
Copy link

Hi
In the example we are retrieving the auth token from the .env files. Is there a way we can access this from the app state.
I am trying to build an app where I store the JWT in the app state that is passed down using context. From the examples, since the RelayEnvironment is not a react component, I cannot use useContext() to get the token. Is there a way to create a Relay Environment such that it can access fields from the store.

Thanks

P.S: I am not storing the JWT in the browser local storage due to security concerns and am using a refresh token to generate new tokens.

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

1 participant