Hello all, I’ve seen some suggested username transformation solutions that utilize fetch calls to other sources (haven’t seen a complete working solution yet). However when attempting to use a fetch call, Okta will continue to sign the user in without waiting for fetch to finish and properly transform the username. Is there anything that I’m missing here? The data comes back properly, but it just doesn’t come back in time even with await.
config.transformUsername = async function(username,operation) {
let url = 'someurl';
const res = await fetch(url);
const data = await res.json();
return data[username]
? data[username]
: username;
}