aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-01-29 16:09:50 +0100
committerChocobozzz <me@florianbigard.com>2018-01-29 16:09:50 +0100
commitba12e8b3a6de8ac82101894abe7460b392fec42a (patch)
tree5f75741fde6b3be093c885c23c582b6d0d3cec20 /server/lib
parent61c04fa9b3566b769b260e414fe59df77cd77031 (diff)
downloadPeerTube-ba12e8b3a6de8ac82101894abe7460b392fec42a.tar.gz
PeerTube-ba12e8b3a6de8ac82101894abe7460b392fec42a.tar.zst
PeerTube-ba12e8b3a6de8ac82101894abe7460b392fec42a.zip
Add ability to login with email
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/oauth-model.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/lib/oauth-model.ts b/server/lib/oauth-model.ts
index b3cc75590..3adcce7b0 100644
--- a/server/lib/oauth-model.ts
+++ b/server/lib/oauth-model.ts
@@ -25,10 +25,10 @@ function getRefreshToken (refreshToken: string) {
25 return OAuthTokenModel.getByRefreshTokenAndPopulateClient(refreshToken) 25 return OAuthTokenModel.getByRefreshTokenAndPopulateClient(refreshToken)
26} 26}
27 27
28async function getUser (username: string, password: string) { 28async function getUser (usernameOrEmail: string, password: string) {
29 logger.debug('Getting User (username: ' + username + ', password: ******).') 29 logger.debug('Getting User (username/email: ' + usernameOrEmail + ', password: ******).')
30 30
31 const user = await UserModel.getByUsername(username) 31 const user = await UserModel.loadByUsernameOrEmail(usernameOrEmail)
32 if (!user) return null 32 if (!user) return null
33 33
34 const passwordMatch = await user.isPasswordMatch(password) 34 const passwordMatch = await user.isPasswordMatch(password)