2020-04-22 09:07:04 -05:00
|
|
|
async function register ({
|
|
|
|
registerIdAndPassAuth,
|
|
|
|
peertubeHelpers
|
|
|
|
}) {
|
|
|
|
registerIdAndPassAuth({
|
2020-04-23 04:36:50 -05:00
|
|
|
authName: 'laguna-bad-auth',
|
2020-04-22 09:07:04 -05:00
|
|
|
|
|
|
|
onLogout: () => {
|
|
|
|
peertubeHelpers.logger.info('On logout for auth 3 - 1')
|
|
|
|
},
|
|
|
|
|
|
|
|
getWeight: () => 5,
|
|
|
|
|
|
|
|
login (body) {
|
|
|
|
if (body.id === 'laguna' && body.password === 'laguna password') {
|
|
|
|
return Promise.resolve({
|
|
|
|
username: 'laguna',
|
|
|
|
email: 'laguna@example.com',
|
|
|
|
displayName: 'Laguna Loire'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
return null
|
|
|
|
}
|
|
|
|
})
|
2020-04-27 04:42:01 -05:00
|
|
|
|
|
|
|
registerIdAndPassAuth({
|
|
|
|
authName: 'ward-auth',
|
|
|
|
|
|
|
|
getWeight: () => 5,
|
|
|
|
|
|
|
|
login (body) {
|
|
|
|
if (body.id === 'ward') {
|
|
|
|
return Promise.resolve({
|
2022-08-03 04:49:39 -05:00
|
|
|
username: '-ward-42',
|
2020-04-27 04:42:01 -05:00
|
|
|
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
|
|
|
|
}
|
|
|
|
})
|
2020-04-22 09:07:04 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
async function unregister () {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
register,
|
|
|
|
unregister
|
|
|
|
}
|
|
|
|
|
|
|
|
// ###########################################################################
|