aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-04-29 10:42:35 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-05-04 16:21:39 +0200
commitebefc902f59be6c5542c19ff706e310d9dddf75f (patch)
tree79eb831217a7938484e191070d6a465bc07a00fd /server
parent9107d791e2eef9a1b24b0499dac8b9dbba8a792f (diff)
downloadPeerTube-ebefc902f59be6c5542c19ff706e310d9dddf75f.tar.gz
PeerTube-ebefc902f59be6c5542c19ff706e310d9dddf75f.tar.zst
PeerTube-ebefc902f59be6c5542c19ff706e310d9dddf75f.zip
Add external login buttons
Diffstat (limited to 'server')
-rw-r--r--server/controllers/api/config.ts4
-rw-r--r--server/lib/plugins/plugin-manager.ts16
2 files changed, 17 insertions, 3 deletions
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts
index e8941bc73..85f3ad3d9 100644
--- a/server/controllers/api/config.ts
+++ b/server/controllers/api/config.ts
@@ -278,6 +278,8 @@ function getIdAndPassAuthPlugins () {
278 for (const auth of p.idAndPassAuths) { 278 for (const auth of p.idAndPassAuths) {
279 result.push({ 279 result.push({
280 npmName: p.npmName, 280 npmName: p.npmName,
281 name: p.name,
282 version: p.version,
281 authName: auth.authName, 283 authName: auth.authName,
282 weight: auth.getWeight() 284 weight: auth.getWeight()
283 }) 285 })
@@ -294,6 +296,8 @@ function getExternalAuthsPlugins () {
294 for (const auth of p.externalAuths) { 296 for (const auth of p.externalAuths) {
295 result.push({ 297 result.push({
296 npmName: p.npmName, 298 npmName: p.npmName,
299 name: p.name,
300 version: p.version,
297 authName: auth.authName, 301 authName: auth.authName,
298 authDisplayName: auth.authDisplayName 302 authDisplayName: auth.authDisplayName
299 }) 303 })
diff --git a/server/lib/plugins/plugin-manager.ts b/server/lib/plugins/plugin-manager.ts
index 38336bcc6..f7b84b1ff 100644
--- a/server/lib/plugins/plugin-manager.ts
+++ b/server/lib/plugins/plugin-manager.ts
@@ -106,14 +106,24 @@ export class PluginManager implements ServerHook {
106 106
107 getIdAndPassAuths () { 107 getIdAndPassAuths () {
108 return this.getRegisteredPlugins() 108 return this.getRegisteredPlugins()
109 .map(p => ({ npmName: p.npmName, idAndPassAuths: p.registerHelpersStore.getIdAndPassAuths() })) 109 .map(p => ({
110 npmName: p.npmName,
111 name: p.name,
112 version: p.version,
113 idAndPassAuths: p.registerHelpersStore.getIdAndPassAuths()
114 }))
110 .filter(v => v.idAndPassAuths.length !== 0) 115 .filter(v => v.idAndPassAuths.length !== 0)
111 } 116 }
112 117
113 getExternalAuths () { 118 getExternalAuths () {
114 return this.getRegisteredPlugins() 119 return this.getRegisteredPlugins()
115 .map(p => ({ npmName: p.npmName, externalAuths: p.registerHelpersStore.getExternalAuths() })) 120 .map(p => ({
116 .filter(v => v.externalAuths.length !== 0) 121 npmName: p.npmName,
122 name: p.name,
123 version: p.version,
124 externalAuths: p.registerHelpersStore.getExternalAuths()
125 }))
126 .filter(v => v.externalAuths.length !== 0)
117 } 127 }
118 128
119 getRegisteredSettings (npmName: string) { 129 getRegisteredSettings (npmName: string) {