]>
Commit | Line | Data |
---|---|---|
9107d791 C |
1 | async function register ({ |
2 | registerExternalAuth, | |
3 | peertubeHelpers | |
4 | }) { | |
5 | { | |
6 | const result = registerExternalAuth({ | |
7 | authName: 'external-auth-3', | |
a5896799 | 8 | authDisplayName: () => 'External Auth 3', |
9107d791 C |
9 | onAuthRequest: (req, res) => { |
10 | result.userAuthenticated({ | |
11 | req, | |
12 | res, | |
13 | username: 'cid', | |
14 | email: 'cid@example.com', | |
15 | displayName: 'Cid Marquez' | |
16 | }) | |
17 | } | |
18 | }) | |
19 | } | |
d253bfaa C |
20 | |
21 | { | |
22 | const result = registerExternalAuth({ | |
23 | authName: 'external-auth-4', | |
24 | authDisplayName: () => 'External Auth 4', | |
25 | onAuthRequest: (req, res) => { | |
26 | result.userAuthenticated({ | |
27 | req, | |
28 | res, | |
29 | username: 'kefka2', | |
30 | email: 'kefka@example.com', | |
31 | displayName: 'Kefka duplication' | |
32 | }) | |
33 | } | |
34 | }) | |
35 | } | |
36 | ||
37 | { | |
38 | const result = registerExternalAuth({ | |
39 | authName: 'external-auth-5', | |
40 | authDisplayName: () => 'External Auth 5', | |
41 | onAuthRequest: (req, res) => { | |
42 | result.userAuthenticated({ | |
43 | req, | |
44 | res, | |
45 | username: 'kefka', | |
46 | email: 'kefka@example.com', | |
47 | displayName: 'Kefka duplication' | |
48 | }) | |
49 | } | |
50 | }) | |
51 | } | |
52 | ||
53 | { | |
54 | const result = registerExternalAuth({ | |
55 | authName: 'external-auth-6', | |
56 | authDisplayName: () => 'External Auth 6', | |
57 | onAuthRequest: (req, res) => { | |
58 | result.userAuthenticated({ | |
59 | req, | |
60 | res, | |
61 | username: 'existing_user', | |
62 | email: 'existing_user@example.com', | |
63 | displayName: 'Existing user' | |
64 | }) | |
65 | } | |
66 | }) | |
67 | } | |
9107d791 C |
68 | } |
69 | ||
70 | async function unregister () { | |
71 | return | |
72 | } | |
73 | ||
74 | module.exports = { | |
75 | register, | |
76 | unregister | |
77 | } | |
78 | ||
79 | // ########################################################################### |