I think I’ve read all of the posts and have been able to successfully implement the whole “getcurrentuserid” function. However, when I preview my site, I’m getting a “user not found” error.
So then I do a search for the userId using console.log in the preview window. I take that userId and search the Contacts database using the code below. I get 0 results.
How can I be the editor and admin of the site and my userId can’t be found? I have a userId, cuz it shows up in the console.log?
Code used to find user info:
export function getContactInfo ( userId ) {
const options = {
suppressAuth : true
};
return contacts . getContact ( userId , options )
. then (( contact ) => {
return contact ;
})
. catch (( error ) => {
console . error ( error );
});
}
I’m so confused!