react-native-event-source icon indicating copy to clipboard operation
react-native-event-source copied to clipboard

How do I refresh authorization token when it expires

Open javatutorials2016 opened this issue 4 years ago • 0 comments

I am setting the authorization header as below. The connection is opened, however, after a while, it starts to fail when the authorization token expires. How do I set the new token(refreshed)?

import RNEventSource from 'react-native-event-source'; function* sseSaga() { const authorization = yield select(getAuthorization); logger.info('sseSaga '); const eventSource = new RNEventSource( environment.server_url + /events?loginProvider=${'google'}, { headers: { authorization: Bearer ${authorization}, }, }, ); }

javatutorials2016 avatar Nov 12 '21 01:11 javatutorials2016