Hi @davimacedo,
The code is as below. While I write my own Login method, which use the phone and password to login, will this be a problem? By my own method, the afterLogin could be triggered as well when login is successful. I just would like to attach the ACL info directly to the user when returned back to frontend.
Parse.Cloud.afterLogin(
async (afterLoginRequest) => {
console.log('afterLoginRequest', afterLoginRequest);
const user = afterLoginRequest.object;
const role = await new Parse.Query(Parse.Role)
.equalTo('name', user.get('roleName'))
.first({ useMasterKey: true });
console.log('user role', role.toJSON());
user.set('roleACL', role.toJSON());
// result.roleACL = role.toJSON();
console.log('afterLogin user.toJSON', user.toJSON());
},
);