はじまりの大地
このコミットが含まれているのは:
@@ -0,0 +1,69 @@
|
||||
async function register ({
|
||||
registerIdAndPassAuth,
|
||||
peertubeHelpers,
|
||||
settingsManager,
|
||||
unregisterIdAndPassAuth
|
||||
}) {
|
||||
registerIdAndPassAuth({
|
||||
authName: 'spyro-auth',
|
||||
|
||||
onLogout: () => {
|
||||
peertubeHelpers.logger.info('On logout for auth 1 - 1')
|
||||
},
|
||||
|
||||
getWeight: () => 15,
|
||||
|
||||
login (body) {
|
||||
if (body.id === 'spyro' && body.password === 'spyro password') {
|
||||
return Promise.resolve({
|
||||
username: 'spyro',
|
||||
email: 'spyro@example.com',
|
||||
role: 2,
|
||||
displayName: 'Spyro the Dragon'
|
||||
})
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
})
|
||||
|
||||
registerIdAndPassAuth({
|
||||
authName: 'crash-auth',
|
||||
|
||||
onLogout: () => {
|
||||
peertubeHelpers.logger.info('On logout for auth 1 - 2')
|
||||
},
|
||||
|
||||
getWeight: () => 50,
|
||||
|
||||
login (body) {
|
||||
if (body.id === 'crash' && body.password === 'crash password') {
|
||||
return Promise.resolve({
|
||||
username: 'crash',
|
||||
email: 'crash@example.com',
|
||||
role: 1,
|
||||
displayName: 'Crash Bandicoot'
|
||||
})
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
})
|
||||
|
||||
settingsManager.onSettingsChange(settings => {
|
||||
if (settings.disableSpyro) {
|
||||
unregisterIdAndPassAuth('spyro-auth')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
async function unregister () {
|
||||
return
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
register,
|
||||
unregister
|
||||
}
|
||||
|
||||
// ###########################################################################
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "peertube-plugin-test-id-pass-auth-one",
|
||||
"version": "0.0.1",
|
||||
"description": "Id and pass auth one",
|
||||
"engine": {
|
||||
"peertube": ">=1.3.0"
|
||||
},
|
||||
"keywords": [
|
||||
"peertube",
|
||||
"plugin"
|
||||
],
|
||||
"homepage": "https://github.com/Chocobozzz/PeerTube",
|
||||
"author": "Chocobozzz",
|
||||
"bugs": "https://github.com/Chocobozzz/PeerTube/issues",
|
||||
"library": "./main.js",
|
||||
"staticDirs": {},
|
||||
"css": [],
|
||||
"clientScripts": [],
|
||||
"translations": {}
|
||||
}
|
||||
新しい課題から参照
ユーザをブロックする