aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-01-30 13:27:07 +0100
committerChocobozzz <me@florianbigard.com>2018-01-30 13:27:07 +0100
commitecb4e35f4e6c7304cb274593c13cb47fd5078b75 (patch)
tree1e238002340bc521afde59d52f406e41298a7aac /server/models
parent80d1057bfcd3582af0dacf5ccd5a7a93ef95410b (diff)
downloadPeerTube-ecb4e35f4e6c7304cb274593c13cb47fd5078b75.tar.gz
PeerTube-ecb4e35f4e6c7304cb274593c13cb47fd5078b75.tar.zst
PeerTube-ecb4e35f4e6c7304cb274593c13cb47fd5078b75.zip
Add ability to reset our password
Diffstat (limited to 'server/models')
-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