aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-02-09 11:47:22 +0100
committerChocobozzz <me@florianbigard.com>2022-02-09 11:54:18 +0100
commit400ed2ab4155689d1695cfbce9358f9ca3a5da60 (patch)
tree399db5508382a8603e5b23233c0117a607557ebd
parent7630e1c893f9848dce9d94135ce9b9a21ab80788 (diff)
downloadPeerTube-400ed2ab4155689d1695cfbce9358f9ca3a5da60.tar.gz
PeerTube-400ed2ab4155689d1695cfbce9358f9ca3a5da60.tar.zst
PeerTube-400ed2ab4155689d1695cfbce9358f9ca3a5da60.zip
Add log on user plugin auth conflict
-rw-r--r--server/lib/auth/oauth-model.ts9
1 files changed, 8 insertions, 1 deletions
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
98 // Then we just go through a regular login process 98 // Then we just go through a regular login process
99 if (user.pluginAuth !== null) { 99 if (user.pluginAuth !== null) {
100 // This user does not belong to this plugin, skip it 100 // This user does not belong to this plugin, skip it
101 if (user.pluginAuth !== bypassLogin.pluginName) return null 101 if (user.pluginAuth !== bypassLogin.pluginName) {
102 logger.info(
103 'Cannot bypass oauth login by plugin %s because %s has another plugin auth method (%s).',
104 bypassLogin.pluginName, bypassLogin.user.email, user.pluginAuth
105 )
106
107 return null
108 }
102 109
103 checkUserValidityOrThrow(user) 110 checkUserValidityOrThrow(user)
104 111