1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 10:19:35 +02:00

Add ability to login with email

This commit is contained in:
Chocobozzz 2018-01-29 16:09:50 +01:00
parent 61c04fa9b3
commit ba12e8b3a6
No known key found for this signature in database
GPG key ID: 583A612D890159BE
4 changed files with 9 additions and 18 deletions

View file

@ -25,10 +25,10 @@ function getRefreshToken (refreshToken: string) {
return OAuthTokenModel.getByRefreshTokenAndPopulateClient(refreshToken)
}
async function getUser (username: string, password: string) {
logger.debug('Getting User (username: ' + username + ', password: ******).')
async function getUser (usernameOrEmail: string, password: string) {
logger.debug('Getting User (username/email: ' + usernameOrEmail + ', password: ******).')
const user = await UserModel.getByUsername(username)
const user = await UserModel.loadByUsernameOrEmail(usernameOrEmail)
if (!user) return null
const passwordMatch = await user.isPasswordMatch(password)