forked from wrenn/wrenn
Fix API key cleanup on user deactivation and build archive race condition
Delete all API keys created by a user when their account is disabled, deleted, or soft-deleted. Store build archives before enqueuing to Redis so workers never dequeue a build with missing files.
This commit is contained in:
@ -524,6 +524,10 @@ func (h *meHandler) DeleteAccount(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
if err := h.db.DeleteAPIKeysByCreator(ctx, ac.UserID); err != nil {
|
||||
slog.Warn("account delete: failed to delete user's API keys", "error", err)
|
||||
}
|
||||
|
||||
if err := h.db.SoftDeleteUser(ctx, ac.UserID); err != nil {
|
||||
writeError(w, http.StatusInternalServerError, "db_error", "failed to delete account")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user