1
0
Fork 0
peertube/server/tests/fixtures/peertube-plugin-test-external-auth-three/main.js
Chocobozzz 74fd2643b4 Provide express request to onLogout call
+ pluginInfo related changes
2020-11-20 15:36:43 +01:00

53 lines
1.2 KiB
JavaScript

async function register ({
registerExternalAuth,
peertubeHelpers
}) {
{
const result = registerExternalAuth({
authName: 'external-auth-7',
authDisplayName: () => 'External Auth 7',
onAuthRequest: (req, res) => {
result.userAuthenticated({
req,
res,
username: 'cid',
email: 'cid@example.com',
displayName: 'Cid Marquez'
})
},
onLogout: (user, req) => {
return 'https://example.com/redirectUrl'
}
})
}
{
const result = registerExternalAuth({
authName: 'external-auth-8',
authDisplayName: () => 'External Auth 8',
onAuthRequest: (req, res) => {
result.userAuthenticated({
req,
res,
username: 'cid',
email: 'cid@example.com',
displayName: 'Cid Marquez'
})
},
onLogout: (user, req) => {
return 'https://example.com/redirectUrl?access_token=' + req.headers['authorization'].split(' ')[1]
}
})
}
}
async function unregister () {
}
module.exports = {
register,
unregister
}
// ###########################################################################