fix: Improved handling of authentication edge-cases (#2023)
* fix: authentication records not cleaned up for deleted user closes #2022 * fix: Improve debugging for duplicate providerId sign-in requests
This commit is contained in:
@ -10,6 +10,7 @@ import { sendEmail } from "../mailer";
|
||||
import { DataTypes, sequelize, encryptedFields, Op } from "../sequelize";
|
||||
import { DEFAULT_AVATAR_HOST } from "../utils/avatars";
|
||||
import { publicS3Endpoint, uploadToS3FromUrl } from "../utils/s3";
|
||||
import UserAuthentication from "./UserAuthentication";
|
||||
import { Star, Team, Collection, NotificationSetting, ApiKey } from ".";
|
||||
|
||||
const User = sequelize.define(
|
||||
@ -208,6 +209,10 @@ const removeIdentifyingInfo = async (model, options) => {
|
||||
where: { userId: model.id },
|
||||
transaction: options.transaction,
|
||||
});
|
||||
await UserAuthentication.destroy({
|
||||
where: { userId: model.id },
|
||||
transaction: options.transaction,
|
||||
});
|
||||
|
||||
model.email = null;
|
||||
model.name = "Unknown";
|
||||
|
Reference in New Issue
Block a user