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:
parent
61c04fa9b3
commit
ba12e8b3a6
4 changed files with 9 additions and 18 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue