Issue
How to pass jwt token in request header of react-native-webview to display protected webpages content.
The below code is not working :
<WebView
source={{
uri: 'website url',
headers: {
Authorization:
'Bearer'+'eyJ0eX...........',
},
}}
/>
Solution
Solution: Use below code
<>
<ActivityIndicator visible={isLoading} />
<WebView
source={{
uri: 'https://.....', headers: {
Authorization: `Bearer ${token}`,
},
}}
onLoadStart={() => setIsLoading(false)}
/>
</>
and then set the cookie from backend
Answered By - Anand Lamani
Answer Checked By - Dawn Plyler (JavaFixing Volunteer)