diff options
Diffstat (limited to 'client/src/app/menu/menu.component.ts')
-rw-r--r-- | client/src/app/menu/menu.component.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/client/src/app/menu/menu.component.ts b/client/src/app/menu/menu.component.ts index 97f07c956..bcc884878 100644 --- a/client/src/app/menu/menu.component.ts +++ b/client/src/app/menu/menu.component.ts | |||
@@ -21,6 +21,7 @@ import { LanguageChooserComponent } from '@app/menu/language-chooser.component' | |||
21 | import { QuickSettingsModalComponent } from '@app/modal/quick-settings-modal.component' | 21 | import { QuickSettingsModalComponent } from '@app/modal/quick-settings-modal.component' |
22 | import { PeertubeModalService } from '@app/shared/shared-main/peertube-modal/peertube-modal.service' | 22 | import { PeertubeModalService } from '@app/shared/shared-main/peertube-modal/peertube-modal.service' |
23 | import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap' | 23 | import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap' |
24 | import { PluginsManager } from '@root-helpers/plugins-manager' | ||
24 | import { HTMLServerConfig, ServerConfig, UserRight, VideoConstant } from '@shared/models' | 25 | import { HTMLServerConfig, ServerConfig, UserRight, VideoConstant } from '@shared/models' |
25 | 26 | ||
26 | const logger = debug('peertube:menu:MenuComponent') | 27 | const logger = debug('peertube:menu:MenuComponent') |
@@ -129,6 +130,15 @@ export class MenuComponent implements OnInit { | |||
129 | .subscribe(() => this.openQuickSettings()) | 130 | .subscribe(() => this.openQuickSettings()) |
130 | } | 131 | } |
131 | 132 | ||
133 | getExternalLoginHref () { | ||
134 | if (this.serverConfig.client.menu.login.redirectOnSingleExternalAuth !== true) return undefined | ||
135 | |||
136 | const externalAuths = this.serverConfig.plugin.registeredExternalAuths | ||
137 | if (externalAuths.length !== 1) return undefined | ||
138 | |||
139 | return PluginsManager.getExternalAuthHref(externalAuths[0]) | ||
140 | } | ||
141 | |||
132 | isRegistrationAllowed () { | 142 | isRegistrationAllowed () { |
133 | if (!this.serverConfig) return false | 143 | if (!this.serverConfig) return false |
134 | 144 | ||