added redirection to url root

This commit is contained in:
Nicolas Constant 2019-10-31 19:58:09 -04:00
parent a23db9b30e
commit bbfb4bc026
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
2 changed files with 12 additions and 1 deletions

View File

@ -101,7 +101,7 @@ export class AddNewAccountComponent implements OnInit {
if (instanceApps.length !== 0) {
return Promise.resolve(instanceApps[0].app);
} else {
const redirect_uri = this.getLocalHostname() + '/register';
const redirect_uri = this.getLocalHostname();
return this.authService.createNewApplication(instance, 'Sengi', redirect_uri, 'read write follow', 'https://nicolasconstant.github.io/sengi/')
.then((appData: AppData) => {
return this.saveNewApp(instance, appData)

View File

@ -1,4 +1,5 @@
import { Component, OnInit, OnDestroy, QueryList, ViewChildren, ElementRef } from "@angular/core";
import { ActivatedRoute, Router } from '@angular/router';
import { Observable, Subscription } from "rxjs";
import { Select } from "@ngxs/store";
import scrollIntoView from "smooth-scroll-into-view-if-needed";
@ -19,10 +20,20 @@ export class StreamsMainDisplayComponent implements OnInit, OnDestroy {
private columnSelectedSub: Subscription;
constructor(
private readonly router: Router,
private readonly activatedRoute: ActivatedRoute,
private readonly navigationService: NavigationService) {
}
ngOnInit() {
this.activatedRoute.queryParams.subscribe(params => {
const code = params['code'];
if (code) {
this.router.navigate(['/register'], { queryParams: { code: code} });
return;
}
});
this.columnSelectedSub = this.navigationService.columnSelectedSubject.subscribe((columnIndex: number) => {
this.focusOnColumn(columnIndex);
});