Add log on user plugin auth conflict

pull/4795/head
Chocobozzz 2022-02-09 11:47:22 +01:00
parent 7630e1c893
commit 400ed2ab41
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 8 additions and 1 deletions

View File

@ -98,7 +98,14 @@ async function getUser (usernameOrEmail?: string, password?: string, bypassLogin
// Then we just go through a regular login process
if (user.pluginAuth !== null) {
// This user does not belong to this plugin, skip it
if (user.pluginAuth !== bypassLogin.pluginName) return null
if (user.pluginAuth !== bypassLogin.pluginName) {
logger.info(
'Cannot bypass oauth login by plugin %s because %s has another plugin auth method (%s).',
bypassLogin.pluginName, bypassLogin.user.email, user.pluginAuth
)
return null
}
checkUserValidityOrThrow(user)