Code noted here no longer works https://web3auth.io/docs/sdk/core-kit/tkey/intrinsic-flow#redirect-page
privateKey
does not exist on result. Please advise which key to use here. In addition I needed to update .directWeb to .customAuthInstance
const init = async () => {
// Initialization of Service Provider
try {
// Init is required for Redirect Flow but skip fetching sw.js and redirect.html )
(tKey.serviceProvider as any).init({ skipInit: true });
if (
window.location.pathname === "/auth" &&
window.location.hash.includes("#state")
) {
let result = await (
tKey.serviceProvider as any
).customAuthInstance.getRedirectResult();
tKey.serviceProvider.postboxKey = new BN(
// This is undefined
(result.result as any).privateKey!,
"hex"
);
}
} catch (error) {
console.error(error);
}
};