From 400ed2ab4155689d1695cfbce9358f9ca3a5da60 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 9 Feb 2022 11:47:22 +0100 Subject: [PATCH] Add log on user plugin auth conflict --- server/lib/auth/oauth-model.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server/lib/auth/oauth-model.ts b/server/lib/auth/oauth-model.ts index b68cce6d2..81b6529d8 100644 --- a/server/lib/auth/oauth-model.ts +++ b/server/lib/auth/oauth-model.ts @@ -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)