Passwordless.init({
contactMethod: "EMAIL_OR_PHONE",
preAPIHook: async (context) => {
let url = context.url;
let requestInit = context.requestInit;
let action = context.action;
if (action === "PASSWORDLESS_CONSUME_CODE") {
context.userContext= {
role: "client"
}
}
return {
requestInit, url
};
}
}),