aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/account
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/account')
-rw-r--r--server/models/account/user.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/server/models/account/user.ts b/server/models/account/user.ts
index 809e821bd..026a8c9a0 100644
--- a/server/models/account/user.ts
+++ b/server/models/account/user.ts
@@ -161,6 +161,16 @@ export class UserModel extends Model<UserModel> {
161 return UserModel.scope('withVideoChannel').findOne(query) 161 return UserModel.scope('withVideoChannel').findOne(query)
162 } 162 }
163 163
164 static loadByEmail (email: string) {
165 const query = {
166 where: {
167 email
168 }
169 }
170
171 return UserModel.findOne(query)
172 }
173
164 static loadByUsernameOrEmail (username: string, email?: string) { 174 static loadByUsernameOrEmail (username: string, email?: string) {
165 if (!email) email = username 175 if (!email) email = username
166 176