fixing the navigation
This commit is contained in:
parent
c993d24484
commit
c40c3436cd
|
@ -57,7 +57,7 @@
|
||||||
|
|
||||||
<div id="appBody" class="child_div_right">
|
<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 -->
|
<!--this should be invisible -->
|
||||||
|
|
|
@ -50,7 +50,7 @@ export class AppComponent implements OnInit {
|
||||||
login(){
|
login(){
|
||||||
console.log("navigating to login")
|
console.log("navigating to login")
|
||||||
//redirect to login page
|
//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();
|
location.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,6 @@ export class GooggleSignInComponent implements OnInit, AfterViewInit, Injectable
|
||||||
//simple_notifier("success",null,"Successful login");
|
//simple_notifier("success",null,"Successful login");
|
||||||
let profile = googleUser.getBasicProfile();
|
let profile = googleUser.getBasicProfile();
|
||||||
this.tokenService.login(googleUser.getAuthResponse().id_token, TokenProvider.google, profile.getName(), profile.getEmail());
|
this.tokenService.login(googleUser.getAuthResponse().id_token, TokenProvider.google, profile.getName(), profile.getEmail());
|
||||||
this.router.navigate(['/workspace'], { queryParams: { /*returnUrl: this.state.url*/ }});
|
|
||||||
},
|
},
|
||||||
function (error) {
|
function (error) {
|
||||||
//simple_notifier("danger",null,"Failed to login");
|
//simple_notifier("danger",null,"Failed to login");
|
||||||
|
|
|
@ -18,8 +18,8 @@ export class UserWorkspaceComponent implements OnInit {
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
||||||
if(!this.tokenService.isLoggedIn())
|
//if(!this.tokenService.isLoggedIn())
|
||||||
this.router.navigate([''], { queryParams: { /*returnUrl: this.state.url*/ }});
|
//this.router.navigate([''], { queryParams: { /*returnUrl: this.state.url*/ }});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue