0

I've been working with this issue of trying to set the authorization header in the relay environment after the user signs-in. I've tried this suggestion React relay injectNetworkLayer is not a function I have tried using a class that wraps the environment has a token property that when updated creates the Authorization header and places the token into it. This also threw an error. There has to be a way to do this but I can't figure it out.

Nate
  • 1
  • 2

1 Answers1

0

How about storing the token in AsyncStorage when you log in, then in your fetch function, you try to read the token form AsyncStorage, and add it as a header if it is not null.

tbergq
  • 724
  • 6
  • 12