Auth Redirect is not working properly
chdalski opened this issue · 2 comments
chdalski commented
Hi there,
the function "Acquires and access token and then passes it to the API call"
function passTokenToApi() { getTokenRedirect(tokenRequest); if (accessToken) { try { callApi(apiConfig.webApi, accessToken); } catch(error) { console.warn(error); } } }
in ms-identity-b2c-javascript-spa/App/authRedirect.js is not working as expected.
It should be something like:
function passTokenToApi() { getTokenRedirect(tokenRequest).then(response => { if (response.accessToken) { try { callApi(apiConfig.webApi, response.accessToken); } catch (error) { console.warn(error); } } }); }