This commit is contained in:
parent
8ebf7c3036
commit
281e424919
|
@ -50,12 +50,14 @@ 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();
|
||||
}
|
||||
|
||||
logout(){
|
||||
this.tokenService.logout();
|
||||
this.router.navigate(['/login'], { queryParams: { /*returnUrl: this.state.url*/ }});
|
||||
this.router.navigate([''], { queryParams: { /*returnUrl: this.state.url*/ }});
|
||||
location.reload();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -17,10 +17,4 @@
|
|||
<div class="tab-pane" id="all-projects">
|
||||
<projects></projects>
|
||||
</div>
|
||||
<div class="tab-pane" id="3a">
|
||||
<h3>We applied clearfix to the tab-content to rid of the gap between the tab and the content</h3>
|
||||
</div>
|
||||
<div class="tab-pane" id="4a">
|
||||
<h3>We use css to change the background color of the content to be equal to the tab</h3>
|
||||
</div>
|
||||
</div>
|
|
@ -2,7 +2,8 @@ import { Component, OnInit } from '@angular/core';
|
|||
|
||||
import { DmpComponent } from '../dmps/dmp.component';
|
||||
import { ProjectsComponent } from '../projects/projects.component';
|
||||
|
||||
import { TokenService, TokenProvider } from '../services/login/token.service';
|
||||
import {Router} from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'user-workspace',
|
||||
|
@ -11,9 +12,15 @@ import { ProjectsComponent } from '../projects/projects.component';
|
|||
})
|
||||
export class UserWorkspaceComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
constructor(public tokenService: TokenService, private router : Router) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
if(!this.tokenService.isLoggedIn())
|
||||
this.router.navigate([''], { queryParams: { /*returnUrl: this.state.url*/ }});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue