From ecb4e35f4e6c7304cb274593c13cb47fd5078b75 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 30 Jan 2018 13:27:07 +0100 Subject: Add ability to reset our password --- server/models/account/user.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'server/models/account') 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 { return UserModel.scope('withVideoChannel').findOne(query) } + static loadByEmail (email: string) { + const query = { + where: { + email + } + } + + return UserModel.findOne(query) + } + static loadByUsernameOrEmail (username: string, email?: string) { if (!email) email = username -- cgit v1.2.3