From d253bfaaa5f42b1fba71dc70de2932fbfdca5421 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 11 May 2020 18:29:06 +0200 Subject: Add other tests to external auth --- .../peertube-plugin-test-external-auth-two/main.js | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'server/tests/fixtures') diff --git a/server/tests/fixtures/peertube-plugin-test-external-auth-two/main.js b/server/tests/fixtures/peertube-plugin-test-external-auth-two/main.js index 126905ffc..1604a7c41 100644 --- a/server/tests/fixtures/peertube-plugin-test-external-auth-two/main.js +++ b/server/tests/fixtures/peertube-plugin-test-external-auth-two/main.js @@ -17,6 +17,54 @@ async function register ({ } }) } + + { + const result = registerExternalAuth({ + authName: 'external-auth-4', + authDisplayName: () => 'External Auth 4', + onAuthRequest: (req, res) => { + result.userAuthenticated({ + req, + res, + username: 'kefka2', + email: 'kefka@example.com', + displayName: 'Kefka duplication' + }) + } + }) + } + + { + const result = registerExternalAuth({ + authName: 'external-auth-5', + authDisplayName: () => 'External Auth 5', + onAuthRequest: (req, res) => { + result.userAuthenticated({ + req, + res, + username: 'kefka', + email: 'kefka@example.com', + displayName: 'Kefka duplication' + }) + } + }) + } + + { + const result = registerExternalAuth({ + authName: 'external-auth-6', + authDisplayName: () => 'External Auth 6', + onAuthRequest: (req, res) => { + result.userAuthenticated({ + req, + res, + username: 'existing_user', + email: 'existing_user@example.com', + displayName: 'Existing user' + }) + } + }) + } } async function unregister () { -- cgit v1.2.3