Here’s the function that is supposed to return access_token:
const initAuth0 = useCallback(async () => {
const token = await getAccessTokenSilently({
authorizationParams: {
audience: ‘my-audience’,
},
});
console.log(‘token’, token);
}, [getAccessTokenSilently]);
useEffect(() => {
initAuth0();
}, [initAuth0]);
However it doesnt return the token on first render, when I refresh the page only then it returns the token, Also I am using loginWithRedirect() function for logging in(facebook, google login)