2020-04-29 09:04:42 +02:00
|
|
|
async function register ({
|
|
|
|
registerExternalAuth,
|
|
|
|
peertubeHelpers
|
|
|
|
}) {
|
|
|
|
{
|
|
|
|
const result = registerExternalAuth({
|
|
|
|
authName: 'external-auth-3',
|
2020-04-30 09:28:39 +02:00
|
|
|
authDisplayName: () => 'External Auth 3',
|
2020-04-29 09:04:42 +02:00
|
|
|
onAuthRequest: (req, res) => {
|
|
|
|
result.userAuthenticated({
|
|
|
|
req,
|
|
|
|
res,
|
|
|
|
username: 'cid',
|
|
|
|
email: 'cid@example.com',
|
|
|
|
displayName: 'Cid Marquez'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
2020-05-11 18:29:06 +02:00
|
|
|
|
|
|
|
{
|
|
|
|
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'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
2022-08-03 10:10:26 +02:00
|
|
|
|
|
|
|
{
|
|
|
|
const result = registerExternalAuth({
|
|
|
|
authName: 'external-auth-7',
|
|
|
|
authDisplayName: () => 'External Auth 7',
|
|
|
|
onAuthRequest: (req, res) => {
|
|
|
|
result.userAuthenticated({
|
|
|
|
req,
|
|
|
|
res,
|
|
|
|
username: 'existing_user2',
|
|
|
|
email: 'custom_email_existing_user2@example.com',
|
|
|
|
displayName: 'Existing user 2'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
2020-04-29 09:04:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
async function unregister () {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
register,
|
|
|
|
unregister
|
|
|
|
}
|
|
|
|
|
|
|
|
// ###########################################################################
|