]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/tests/fixtures/peertube-plugin-test-id-pass-auth-three/main.js
Support logout and add id and pass tests
[github/Chocobozzz/PeerTube.git] / server / tests / fixtures / peertube-plugin-test-id-pass-auth-three / main.js
1 async function register ({
2 registerIdAndPassAuth,
3 peertubeHelpers
4 }) {
5 registerIdAndPassAuth({
6 authName: 'laguna-bad-auth',
7
8 onLogout: () => {
9 peertubeHelpers.logger.info('On logout for auth 3 - 1')
10 },
11
12 getWeight: () => 5,
13
14 login (body) {
15 if (body.id === 'laguna' && body.password === 'laguna password') {
16 return Promise.resolve({
17 username: 'laguna',
18 email: 'laguna@example.com',
19 displayName: 'Laguna Loire'
20 })
21 }
22
23 return null
24 }
25 })
26 }
27
28 async function unregister () {
29 return
30 }
31
32 module.exports = {
33 register,
34 unregister
35 }
36
37 // ###########################################################################