Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
fix: profile settings domain (#9758)
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiejaoude authored Nov 10, 2023
1 parent 6ef1e6a commit 17d43e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pages/api/account/manage/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ export async function updateSettingsApi(context, username, data) {
update.domain = update.domain.replaceAll(".", "|"); // TODO: use getter/setter instead

// check if domain is already used
if (update.domain) {
if (data.domain && data.domain !== beforeUpdate.domain) {
const domainCheck = await Profile.findOne({
"settings.domain": update.domain,
});
if (domainCheck) {
const domainCheckError = `Domain "${update.domain}" is already in use for username: ${username}`;
const domainCheckError = `Domain "${data.domain}" is already in use for username: ${username}`;
log.error(domainCheckError);
return { error: domainCheckError };
}
Expand Down

0 comments on commit 17d43e6

Please sign in to comment.