remove google account details on unlink

main
alex 2024-02-12 21:52:21 +01:00
parent fb47d7d0bd
commit 64e4037b39
2 changed files with 15 additions and 1 deletions

View File

@ -420,6 +420,20 @@ export async function UnlinkGoogleCalendar(req: Request, res: Response) {
userId: userSession.user_id,
});
// set user google account data to null
await User.update(
{
google_account_name: "",
google_account_picture: "",
},
{
where: {
user_id: userSession.user_id,
},
}
);
res.status(200).send({ msg: "success" });
} catch (error) {
logger.error(error);

View File

@ -93,7 +93,7 @@ User.init(
},
google_account_picture: {
type: DataTypes.STRING,
allowNull: true,
allowNull: true, // varchar(1050) needs to be set manually
},
analytics_enabled: {
type: DataTypes.BOOLEAN,