fixing the navigation

This commit is contained in:
Nikolaos Laskaris 2017-11-10 17:53:53 +02:00
parent c993d24484
commit c40c3436cd
4 changed files with 7 additions and 8 deletions

View File

@ -56,10 +56,10 @@
-->
<div id="appBody" class="child_div_right">
<router-outlet [ngClass]="{true:'visible'}[tokenService.isLoggedIn() == true]" ></router-outlet>
<router-outlet></router-outlet>
<!--this should be invisible -->
<app-main-sign-in [ngClass]="'invisible'"></app-main-sign-in>

View File

@ -50,7 +50,7 @@ export class AppComponent implements OnInit {
login(){
console.log("navigating to login")
//redirect to login page
this.router.navigate(['/login'], { queryParams: { refresh : Math.random() /*,returnUrl: this.state.url*/ }});
this.router.navigate(['/login'], { queryParams: { /*refresh : Math.random() ,returnUrl: this.state.url*/ }});
location.reload();
}

View File

@ -75,7 +75,6 @@ export class GooggleSignInComponent implements OnInit, AfterViewInit, Injectable
//simple_notifier("success",null,"Successful login");
let profile = googleUser.getBasicProfile();
this.tokenService.login(googleUser.getAuthResponse().id_token, TokenProvider.google, profile.getName(), profile.getEmail());
this.router.navigate(['/workspace'], { queryParams: { /*returnUrl: this.state.url*/ }});
},
function (error) {
//simple_notifier("danger",null,"Failed to login");

View File

@ -18,8 +18,8 @@ export class UserWorkspaceComponent implements OnInit {
ngOnInit() {
if(!this.tokenService.isLoggedIn())
this.router.navigate([''], { queryParams: { /*returnUrl: this.state.url*/ }});
//if(!this.tokenService.isLoggedIn())
//this.router.navigate([''], { queryParams: { /*returnUrl: this.state.url*/ }});
}