diff --git a/src/app/components/floating-column/add-new-account/add-new-account.component.ts b/src/app/components/floating-column/add-new-account/add-new-account.component.ts index fd370cbf..a031f780 100644 --- a/src/app/components/floating-column/add-new-account/add-new-account.component.ts +++ b/src/app/components/floating-column/add-new-account/add-new-account.component.ts @@ -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) diff --git a/src/app/pages/streams-main-display/streams-main-display.component.ts b/src/app/pages/streams-main-display/streams-main-display.component.ts index 96c0309a..856c4265 100644 --- a/src/app/pages/streams-main-display/streams-main-display.component.ts +++ b/src/app/pages/streams-main-display/streams-main-display.component.ts @@ -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); });