X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Ffixtures%2Fpeertube-plugin-test-id-pass-auth-three%2Fmain.js;h=1200acfbd27c2a98f120ddc59c0c1056647a9e3e;hb=47d883de2efbc2e8b5f6f94ae18c15224cbe982b;hp=372f3fa0c1c0f11aa06baa2edd077df824a46065;hpb=e1c5503114deef954731904695cd40dccfcef555;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/fixtures/peertube-plugin-test-id-pass-auth-three/main.js b/server/tests/fixtures/peertube-plugin-test-id-pass-auth-three/main.js index 372f3fa0c..1200acfbd 100644 --- a/server/tests/fixtures/peertube-plugin-test-id-pass-auth-three/main.js +++ b/server/tests/fixtures/peertube-plugin-test-id-pass-auth-three/main.js @@ -23,6 +23,75 @@ async function register ({ return null } }) + + registerIdAndPassAuth({ + authName: 'ward-auth', + + getWeight: () => 5, + + login (body) { + if (body.id === 'ward') { + return Promise.resolve({ + username: '-ward-42', + email: 'ward@example.com' + }) + } + + return null + } + }) + + registerIdAndPassAuth({ + authName: 'kiros-auth', + + getWeight: () => 5, + + login (body) { + if (body.id === 'kiros') { + return Promise.resolve({ + username: 'kiros', + email: 'kiros@example.com', + displayName: 'a'.repeat(5000) + }) + } + + return null + } + }) + + registerIdAndPassAuth({ + authName: 'raine-auth', + + getWeight: () => 5, + + login (body) { + if (body.id === 'raine') { + return Promise.resolve({ + username: 'raine', + email: 'raine@example.com', + role: 42 + }) + } + + return null + } + }) + + registerIdAndPassAuth({ + authName: 'ellone-auth', + + getWeight: () => 5, + + login (body) { + if (body.id === 'ellone') { + return Promise.resolve({ + username: 'ellone' + }) + } + + return null + } + }) } async function unregister () {