I have a webapp with Node and React app. From Node, I have integrated ExpressOIDC with all the confg. Everything is working, getting the UserInfo and all the details. But when I try to make a fetch call(API call/ Ajax call) in REACT, I am getting userInfo undefined. But when I hit the API directly from Browser I am getting the userDetails.
Based on the code provided, it seems that fetchuserInfo() does not resolve the fetch() promise.
Regarding authenticating the request, yes, you can use @okta/jwt-verifier in order to verify the bearer token locally and allow the user to access the resources requested.