Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add src != dest user check to the migrateUser function #5916

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/lib/util/migrateUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ export async function migrateUser(_source: string | MUser, _dest: string | MUser
const sourceUser = typeof _source === 'string' ? await mUserFetch(_source) : _source;
const destUser = typeof _dest === 'string' ? await mUserFetch(_dest) : _dest;

if (sourceUser.id === destUser.id) {
throw new UserError('Destination user cannot be the same as the source!');
}

// First check for + cancel active GE Listings:
await Promise.all([cancelUsersListings(sourceUser), cancelUsersListings(destUser)]);

Expand Down
Loading