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

Add other tests to external auth

This commit is contained in:
Chocobozzz 2020-05-11 18:29:06 +02:00
parent 5ff523664f
commit d253bfaaa5
No known key found for this signature in database
GPG key ID: 583A612D890159BE
3 changed files with 96 additions and 6 deletions

View file

@ -123,7 +123,7 @@ async function getUser (usernameOrEmail?: string, password?: string) {
const user = await UserModel.loadByUsernameOrEmail(usernameOrEmail)
// If we don't find the user, or if the user belongs to a plugin
if (!user || user.pluginAuth !== null) return null
if (!user || user.pluginAuth !== null || !password) return null
const passwordMatch = await user.isPasswordMatch(password)
if (passwordMatch !== true) return null