diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2019-07-10 18:30:58 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-07-10 18:30:58 +0900 |
| commit | ab871c69917ec255c98babe052e9ca018c68c079 (patch) | |
| tree | ce216498cef67ae1cd7ff4fbbebefc1a1c939ccb /src/server | |
| parent | Pages: Implement radio button (diff) | |
| parent | Prevent duplicate user registration (#5129) (diff) | |
| download | sharkey-ab871c69917ec255c98babe052e9ca018c68c079.tar.gz sharkey-ab871c69917ec255c98babe052e9ca018c68c079.tar.bz2 sharkey-ab871c69917ec255c98babe052e9ca018c68c079.zip | |
Merge branch 'develop' of https://github.com/syuilo/misskey into develop
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/api/private/signup.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/server/api/private/signup.ts b/src/server/api/private/signup.ts index ca197a6611..ac99ea0d33 100644 --- a/src/server/api/private/signup.ts +++ b/src/server/api/private/signup.ts @@ -104,6 +104,13 @@ export default async (ctx: Koa.BaseContext) => { // Start transaction await getConnection().transaction(async transactionalEntityManager => { + const exist = await transactionalEntityManager.findOne(User, { + usernameLower: username.toLowerCase(), + host: null + }); + + if (exist) throw 'already registered'; + account = await transactionalEntityManager.save(new User({ id: genId(), createdAt: new Date(), |