This commit is contained in:
parent
6f605960e5
commit
26a2c765cc
|
@ -8,7 +8,7 @@
|
|||
</button>
|
||||
-->
|
||||
<div class="nav navbar-nav navbar-left">
|
||||
<div class="dropdown ">
|
||||
<div class="dropdown" [ngClass]="{false:'invisible'}[tokenService.isLoggedIn() == true]">
|
||||
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown"> Manage <span class="caret"></span> </button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a class="cursor" (click)="goToDMPs()">My DMPs</a></li>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { Injectable, Inject} from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import {LocalStorageService} from 'ngx-webstorage';
|
||||
import {Router} from '@angular/router';
|
||||
import 'rxjs/add/operator/map';
|
||||
import { DOCUMENT } from '@angular/platform-browser';
|
||||
|
||||
|
@ -13,7 +14,7 @@ declare function sign_out_google(): any;
|
|||
@Injectable()
|
||||
export class TokenService {
|
||||
|
||||
constructor (private storage : LocalStorageService, @Inject(DOCUMENT) private document) {
|
||||
constructor (private storage : LocalStorageService, @Inject(DOCUMENT) private document, private router : Router) {
|
||||
//var csrfToken : string = jQuery(document).find('meta[name="csrf-token"]').attr('content');
|
||||
//this.setCSRFToken(csrfToken);
|
||||
}
|
||||
|
@ -96,7 +97,9 @@ export class TokenService {
|
|||
|
||||
this.setProvider(null);
|
||||
|
||||
window.location.reload();
|
||||
this.router.navigate(['/login'], { queryParams: { /*returnUrl: this.state.url*/ }});
|
||||
|
||||
//window.location.reload();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue