π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Disable all links on account deletion
Neeraj Guptac57d4679656b
diff --git a/server/cmd/museum/main.go b/server/cmd/museum/main.goindex 17c7b5ba42..9b22620181 100644--- a/server/cmd/museum/main.go+++ b/server/cmd/museum/main.go@@ -308,6 +308,7 @@ func main() {FileController: fileController,EmailNotificationCtrl: emailNotificationCtrl,CollectionLinkRepo: collectionLinkRepo,+ FileLinkRepo: fileLinkRepo,CollectionRepo: collectionRepo,UserRepo: userRepo,JwtSecret: jwtSecretBytes,diff --git a/server/pkg/controller/public/collection_link.go b/server/pkg/controller/public/collection_link.goindex 52ca2d7689..ead744bfbf 100644--- a/server/pkg/controller/public/collection_link.go+++ b/server/pkg/controller/public/collection_link.go@@ -54,6 +54,7 @@ type CollectionLinkController struct {FileController *controller.FileControllerEmailNotificationCtrl *emailCtrl.EmailNotificationControllerCollectionLinkRepo *public.CollectionLinkRepo+ FileLinkRepo *public.FileLinkRepositoryCollectionRepo *repo.CollectionRepositoryUserRepo *repo.UserRepositoryJwtSecret []byte@@ -270,7 +271,7 @@ func (c *CollectionLinkController) HandleAccountDeletion(ctx context.Context, usreturn stacktrace.Propagate(err, "")}}- return nil+ return c.FileLinkRepo.DisableLinksForUser(ctx, userID)}// GetPublicCollection will return collection info for a public url.diff --git a/server/pkg/repo/public/file_link.go b/server/pkg/repo/public/file_link.goindex c03b74c693..beaeda2e74 100644--- a/server/pkg/repo/public/file_link.go+++ b/server/pkg/repo/public/file_link.go@@ -124,8 +124,8 @@ func (pcr *FileLinkRepository) DisableLinkForFiles(ctx context.Context, fileIDs}// DisableLinksForUser will disable all public file links for the given user-func (pcr *FileLinkRepository) DisableLinksForUser(ctx context.Context, linkID string) error {- _, err := pcr.DB.ExecContext(ctx, `UPDATE public_file_tokens SET is_disabled = TRUE WHERE id = $1`, linkID)+func (pcr *FileLinkRepository) DisableLinksForUser(ctx context.Context, userID int64) error {+ _, err := pcr.DB.ExecContext(ctx, `UPDATE public_file_tokens SET is_disabled = TRUE WHERE owner_id = $1`, userID)if err != nil {return stacktrace.Propagate(err, "failed to disable public file link")}