diff options
author | Chocobozzz <me@florianbigard.com> | 2023-02-14 11:47:01 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-02-14 11:51:44 +0100 |
commit | 98bd5e2256bfdeba6d5ab07f0421acfde1a0de26 (patch) | |
tree | a1193f1af10f0da7a532d4aa6d5045e51c3d16a9 /client/src/app/shared/shared-user-subscription | |
parent | 4ea827076df39935375d66fffb5e1e27e667111e (diff) | |
download | PeerTube-98bd5e2256bfdeba6d5ab07f0421acfde1a0de26.tar.gz PeerTube-98bd5e2256bfdeba6d5ab07f0421acfde1a0de26.tar.zst PeerTube-98bd5e2256bfdeba6d5ab07f0421acfde1a0de26.zip |
Refactor login redirection/button links
Correctly handle external auth redirection in all cases
Diffstat (limited to 'client/src/app/shared/shared-user-subscription')
-rw-r--r-- | client/src/app/shared/shared-user-subscription/subscribe-button.component.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/client/src/app/shared/shared-user-subscription/subscribe-button.component.ts b/client/src/app/shared/shared-user-subscription/subscribe-button.component.ts index 7a55a6ffb..a002bf4e7 100644 --- a/client/src/app/shared/shared-user-subscription/subscribe-button.component.ts +++ b/client/src/app/shared/shared-user-subscription/subscribe-button.component.ts | |||
@@ -1,7 +1,6 @@ | |||
1 | import { concat, forkJoin, merge } from 'rxjs' | 1 | import { concat, forkJoin, merge } from 'rxjs' |
2 | import { Component, Input, OnChanges, OnInit } from '@angular/core' | 2 | import { Component, Input, OnChanges, OnInit } from '@angular/core' |
3 | import { Router } from '@angular/router' | 3 | import { AuthService, Notifier, RedirectService } from '@app/core' |
4 | import { AuthService, Notifier } from '@app/core' | ||
5 | import { Account, VideoChannel, VideoService } from '@app/shared/shared-main' | 4 | import { Account, VideoChannel, VideoService } from '@app/shared/shared-main' |
6 | import { FeedFormat } from '@shared/models' | 5 | import { FeedFormat } from '@shared/models' |
7 | import { UserSubscriptionService } from './user-subscription.service' | 6 | import { UserSubscriptionService } from './user-subscription.service' |
@@ -27,7 +26,7 @@ export class SubscribeButtonComponent implements OnInit, OnChanges { | |||
27 | 26 | ||
28 | constructor ( | 27 | constructor ( |
29 | private authService: AuthService, | 28 | private authService: AuthService, |
30 | private router: Router, | 29 | private redirectService: RedirectService, |
31 | private notifier: Notifier, | 30 | private notifier: Notifier, |
32 | private userSubscriptionService: UserSubscriptionService, | 31 | private userSubscriptionService: UserSubscriptionService, |
33 | private videoService: VideoService | 32 | private videoService: VideoService |
@@ -152,7 +151,7 @@ export class SubscribeButtonComponent implements OnInit, OnChanges { | |||
152 | } | 151 | } |
153 | 152 | ||
154 | gotoLogin () { | 153 | gotoLogin () { |
155 | this.router.navigate([ '/login' ]) | 154 | this.redirectService.redirectToLogin() |
156 | } | 155 | } |
157 | 156 | ||
158 | subscribeStatus (subscribed: boolean) { | 157 | subscribeStatus (subscribed: boolean) { |