hellowmellow on Nostr: cool. Also, a quick question. Is there a way to add for the api to check if the user ...
cool. Also, a quick question. Is there a way to add for the api to check if the user already exists and then prevent registration instead of appending digits and letters to the newer ones? Maybe something like this:
<code> // Check existing
const existingUser = await user.getUidByUsername(username);
if (existingUser) {
return helpers.formatResponse(400, res, { message: 'Username not available' });
}
</code>
<code> // Check existing
const existingUser = await user.getUidByUsername(username);
if (existingUser) {
return helpers.formatResponse(400, res, { message: 'Username not available' });
}
</code>