socialnetworknews-web

A open-source Paper.li clone
git clone git://archive.git.mtrnord.blog/SocialNetworkNews/socialnetworknews-web.git
Log | Files | Refs | README | LICENSE

commit ce005156817d5932ffaa8499b3dfb9dbf1efe8d4
parent 3c2cea68642229125308107739cfd62a013cbf5e
Author: MTRNord <mtrnord1@gmail.com>
Date:   Tue,  3 Apr 2018 17:29:11 +0200

Make use of login API changes

Diffstat:
Msrc/app/api.service.ts | 2+-
Msrc/app/app.component.html | 2+-
Msrc/app/app.component.ts | 2+-
Msrc/app/callback/twitter/twitter.component.ts | 2+-
4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/app/api.service.ts b/src/app/api.service.ts @@ -44,7 +44,7 @@ export interface Author { @Injectable() export class ApiService { url: string; - authToken: string; + userUUID: string; constructor(@Inject(DOCUMENT) private document, private http: HttpClient) { this.url = document.location.protocol + '//' + document.location.hostname + '/api'; } diff --git a/src/app/app.component.html b/src/app/app.component.html @@ -12,7 +12,7 @@ <a class="nav--link" routerLink="/features">Features</a> <a class="nav--link" routerLink="/papers">Papers</a> <a class="nav--link" *ngIf="!authenticated" routerLink="/login">Login</a> - <a class="nav--link" *ngIf="authenticated" routerLink="/profile">Profile</a> + <a class="nav--link" *ngIf="authenticated" routerLink="/profile/{{apiService.userUUID}}">Profile</a> </nav> </div> diff --git a/src/app/app.component.ts b/src/app/app.component.ts @@ -13,7 +13,7 @@ export class AppComponent implements OnInit { public spinner = SpinnerComponent; authenticated: boolean; - constructor(private apiService: ApiService, private toastr: ToastrService) { } + constructor(public apiService: ApiService, private toastr: ToastrService) { } ngOnInit() { this.apiService.checkIfUserIsAuthenticated() diff --git a/src/app/callback/twitter/twitter.component.ts b/src/app/callback/twitter/twitter.component.ts @@ -54,7 +54,7 @@ export class TwitterComponent implements OnInit { }) .subscribe( data => { - this.apiService.authToken = data.headers.get('authorization'); + this.apiService.userUUID = data.headers.get('UUID'); // TODO redirect to the Profile instead of home page this.router.navigate(['/']);