aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/root-helpers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-12-03 17:04:47 +0100
committerChocobozzz <me@florianbigard.com>2021-12-03 17:04:47 +0100
commit0bc53e20296de68288481e2375b297626087174b (patch)
treea5d45a622932ee3539369dfeb9a84889176fd6f5 /client/src/root-helpers
parentd1a233d8d86ead1e3aa2350d5480eab3336b17d6 (diff)
downloadPeerTube-0bc53e20296de68288481e2375b297626087174b.tar.gz
PeerTube-0bc53e20296de68288481e2375b297626087174b.tar.zst
PeerTube-0bc53e20296de68288481e2375b297626087174b.zip
Add ability to redirect users on external auth
Diffstat (limited to 'client/src/root-helpers')
-rw-r--r--client/src/root-helpers/plugins-manager.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/client/src/root-helpers/plugins-manager.ts b/client/src/root-helpers/plugins-manager.ts
index a1b763ff2..9cba63373 100644
--- a/client/src/root-helpers/plugins-manager.ts
+++ b/client/src/root-helpers/plugins-manager.ts
@@ -15,6 +15,7 @@ import {
15 RegisterClientHookOptions, 15 RegisterClientHookOptions,
16 RegisterClientSettingsScript, 16 RegisterClientSettingsScript,
17 RegisterClientVideoFieldOptions, 17 RegisterClientVideoFieldOptions,
18 RegisteredExternalAuthConfig,
18 ServerConfigPlugin 19 ServerConfigPlugin
19} from '../../../shared/models' 20} from '../../../shared/models'
20import { environment } from '../environments/environment' 21import { environment } from '../environments/environment'
@@ -78,6 +79,11 @@ class PluginsManager {
78 return isTheme ? '/themes' : '/plugins' 79 return isTheme ? '/themes' : '/plugins'
79 } 80 }
80 81
82 static getExternalAuthHref (auth: RegisteredExternalAuthConfig) {
83 return environment.apiUrl + `/plugins/${auth.name}/${auth.version}/auth/${auth.authName}`
84
85 }
86
81 loadPluginsList (config: HTMLServerConfig) { 87 loadPluginsList (config: HTMLServerConfig) {
82 for (const plugin of config.plugin.registered) { 88 for (const plugin of config.plugin.registered) {
83 this.addPlugin(plugin) 89 this.addPlugin(plugin)