login error fetching data Request failed with status code 403

Hi
When I login I got “error fetching data Request failed with status code 403” in the console
last week it was working
I’m using wix custom login (no external API) private member data db
code in master page
wixUsers . onLogin ( async ( user ) => {
let users = wixUsers.currentUser;
let currentUserEmail = users.getEmail();
console.log(users)
console.log(currentUserEmail)
console.log(user.getEmail)

    user.getRoles() 
        .then( (roles) => { 

// TODO
}

the code failed on callback timeout at siteMembersApi:186:13
Thanks

Hello from the Wix DevRel Team!

The first issue that jumps out at me is that you’re using async without using the await before the variables that you’re assigning.

Based on our example code , I don’t believe it’s necessary to use async/await at all, so I would try it first without using async/await and second by keeping async and adding await in front of all of the variables assignments you’re making. Writing out those cases below:

wixUsers.onLogin((user) => {
let users = wixUsers.currentUser;
let currentUserEmail = users.getEmail();
console.log(users)
console.log(currentUserEmail)
console.log(user.getEmail)
user.getRoles().then( (roles) => {
// TODO
}
wixUsers.onLogin(async (user) => {
let users = await wixUsers.currentUser;
let currentUserEmail = await users.getEmail();
console.log(users)
console.log(currentUserEmail)
console.log(user.getEmail)
user.getRoles().then( (roles) => {
// TODO
}

Hope this helps!

Rob