[skip ci] feat: prepare for public release
This commit is contained in:
@@ -205,6 +205,8 @@ export const UserAccountController = (app: HonoApp) => {
|
||||
const emailTokenProvided = emailToken !== undefined;
|
||||
const isUnclaimed = !user.passwordHash;
|
||||
if (isUnclaimed) {
|
||||
const {username: _ignoredUsername, discriminator: _ignoredDiscriminator, ...rest} = userUpdateData;
|
||||
userUpdateData = rest;
|
||||
const allowed = new Set(['new_password']);
|
||||
const disallowedField = Object.keys(userUpdateData).find((key) => !allowed.has(key));
|
||||
if (disallowedField) {
|
||||
|
||||
@@ -34,6 +34,7 @@ import {
|
||||
HarvestOnCooldownError,
|
||||
MaxBookmarksError,
|
||||
MissingPermissionsError,
|
||||
UnclaimedAccountRestrictedError,
|
||||
UnknownChannelError,
|
||||
UnknownHarvestError,
|
||||
UnknownMessageError,
|
||||
@@ -120,6 +121,10 @@ export class UserContentService {
|
||||
throw new UnknownUserError();
|
||||
}
|
||||
|
||||
if (!user.passwordHash && !user.isBot) {
|
||||
throw new UnclaimedAccountRestrictedError('create beta codes');
|
||||
}
|
||||
|
||||
const existingBetaCodes = await this.userContentRepository.listBetaCodes(userId);
|
||||
const unclaimedCount = existingBetaCodes.filter((code) => !code.redeemerId).length;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user