aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core/routing/redirect.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/core/routing/redirect.service.ts')
-rw-r--r--client/src/app/core/routing/redirect.service.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/client/src/app/core/routing/redirect.service.ts b/client/src/app/core/routing/redirect.service.ts
index 1344458d5..e239c6210 100644
--- a/client/src/app/core/routing/redirect.service.ts
+++ b/client/src/app/core/routing/redirect.service.ts
@@ -4,6 +4,8 @@ import { NavigationCancel, NavigationEnd, Router } from '@angular/router'
4import { logger } from '@root-helpers/logger' 4import { logger } from '@root-helpers/logger'
5import { ServerService } from '../server' 5import { ServerService } from '../server'
6import { SessionStorageService } from '../wrappers/storage.service' 6import { SessionStorageService } from '../wrappers/storage.service'
7import { PluginsManager } from '@root-helpers/plugins-manager'
8import { environment } from 'src/environments/environment'
7 9
8const debugLogger = debug('peertube:router:RedirectService') 10const debugLogger = debug('peertube:router:RedirectService')
9 11
@@ -100,6 +102,13 @@ export class RedirectService {
100 102
101 } 103 }
102 104
105 redirectToLogin () {
106 const externalLoginUrl = PluginsManager.getDefaultLoginHref(environment.apiUrl, this.serverService.getHTMLConfig())
107
108 if (externalLoginUrl) window.location.href = externalLoginUrl
109 else this.router.navigate([ '/login' ])
110 }
111
103 private doRedirect (redirectUrl: string, fallbackRoute?: string) { 112 private doRedirect (redirectUrl: string, fallbackRoute?: string) {
104 debugLogger('Redirecting on %s', redirectUrl) 113 debugLogger('Redirecting on %s', redirectUrl)
105 114