Pretty sure a tried and true code. Had been working, but now not working.
It is intermittent on pulling info into user input...half the time have to refresh page to get it to pull up, but then it is not actually putting info into the field on submit (was previously working fine).
import wixUsers from 'wix-users'; // ... let user = wixUsers.currentUser; let userId = user.id; let isLoggedIn = user.loggedIn; let userRole = user.role; user.getEmail() .then( (email) => { let userEmail = email; // "user@something.com" $w("#input23").value = userEmail; } );
The thread is being closed.
Did you ever find a way to fix this? I am having the same issue using input fields. Seems to work fine when I use a wix form.
Make sure the code is in the onReady function.