So, here’s an update. When I use the function…
currentMember.getMember(options)
11 .then((member) => {
12 const id = member._id;
13 const fullName = `${member.contactDetails.firstName} ${member.contactDetails.lastName}`;
14 return member;
15 })
16 .catch((error) => {
17 console.error(error);
18 });
…it returns the wrong user. I tried reverting to the deprecated function…
import wixUsers from 'wix-users';
2
3// ...
4
5let user = wixUsers.currentUser;
6
7let userId = user.id; // "r5cme-6fem-485j-djre-4844c49"
8let isLoggedIn = user.loggedIn; // true
…and it works like a charm! No idea why though.