|
@@ -55,6 +55,16 @@ export function defineUserBeforeSave(){
|
|
|
// console.log(user.toJSON());
|
|
|
// console.log(user?.get("password"))
|
|
|
let authingUserExists = await findUserByMobileEmailUserName(user)
|
|
|
+ if(authingUserExists?.statusCode==200){
|
|
|
+ let existsUser = authingUserExists?.data;
|
|
|
+ let deleteRes = await managementClient.deleteUsersBatch({
|
|
|
+ // 替换用户 ID 数组
|
|
|
+ userIds: [existsUser.userId],
|
|
|
+ options: {
|
|
|
+ userIdType: "user_id"
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
/**
|
|
@@ -156,8 +166,7 @@ async function syncUserProfileToAuthing(user,profile){
|
|
|
let authingUserExists = await findUserByMobileEmailUserName(user)
|
|
|
if(authingUserExists?.statusCode==200){
|
|
|
let existsUser = authingUserExists?.data;
|
|
|
- userInfo.userId = existsUser.userId
|
|
|
-
|
|
|
+ userInfo.userId = existsUser.userId
|
|
|
}
|
|
|
delete userInfo.objectId
|
|
|
userInfo.identifyStatus = userInfo.accountState
|