|
|
@ -4,20 +4,18 @@ import { |
|
|
} from '@ghostfolio/client/services/settings-storage.service'; |
|
|
} from '@ghostfolio/client/services/settings-storage.service'; |
|
|
import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service'; |
|
|
import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service'; |
|
|
|
|
|
|
|
|
import { Component, OnDestroy, OnInit } from '@angular/core'; |
|
|
import { Component, DestroyRef, OnInit } from '@angular/core'; |
|
|
|
|
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; |
|
|
import { ActivatedRoute, Router } from '@angular/router'; |
|
|
import { ActivatedRoute, Router } from '@angular/router'; |
|
|
import { Subject } from 'rxjs'; |
|
|
|
|
|
import { takeUntil } from 'rxjs/operators'; |
|
|
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
@Component({ |
|
|
selector: 'gf-auth-page', |
|
|
selector: 'gf-auth-page', |
|
|
styleUrls: ['./auth-page.scss'], |
|
|
styleUrls: ['./auth-page.scss'], |
|
|
templateUrl: './auth-page.html' |
|
|
templateUrl: './auth-page.html' |
|
|
}) |
|
|
}) |
|
|
export class GfAuthPageComponent implements OnDestroy, OnInit { |
|
|
export class GfAuthPageComponent implements OnInit { |
|
|
private unsubscribeSubject = new Subject<void>(); |
|
|
|
|
|
|
|
|
|
|
|
public constructor( |
|
|
public constructor( |
|
|
|
|
|
private destroyRef: DestroyRef, |
|
|
private route: ActivatedRoute, |
|
|
private route: ActivatedRoute, |
|
|
private router: Router, |
|
|
private router: Router, |
|
|
private settingsStorageService: SettingsStorageService, |
|
|
private settingsStorageService: SettingsStorageService, |
|
|
@ -26,7 +24,7 @@ export class GfAuthPageComponent implements OnDestroy, OnInit { |
|
|
|
|
|
|
|
|
public ngOnInit() { |
|
|
public ngOnInit() { |
|
|
this.route.params |
|
|
this.route.params |
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
.subscribe((params) => { |
|
|
.subscribe((params) => { |
|
|
const jwt = params['jwt']; |
|
|
const jwt = params['jwt']; |
|
|
|
|
|
|
|
|
@ -38,9 +36,4 @@ export class GfAuthPageComponent implements OnDestroy, OnInit { |
|
|
this.router.navigate(['/']); |
|
|
this.router.navigate(['/']); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public ngOnDestroy() { |
|
|
|
|
|
this.unsubscribeSubject.next(); |
|
|
|
|
|
this.unsubscribeSubject.complete(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|