Added better routing and auto logout on login

Note that this is fully working auth login now
This commit is contained in:
piratefinn 2017-06-08 16:05:01 +01:00
parent c7810de2b6
commit 845b166364
5 changed files with 27 additions and 9 deletions

View file

@ -1,6 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { ApiService } from '../providers/api-service';
import {Router } from '@angular/router';
import { Router } from '@angular/router';
@Component({
selector: 'app-dashboard',
@ -26,6 +26,7 @@ export class FullLayoutComponent implements OnInit {
}
ngOnInit(): void {}
userlogout() {
console.log('logout clicked');
this.api
@ -33,6 +34,7 @@ export class FullLayoutComponent implements OnInit {
.subscribe(
result => {
console.log('Logged out!');
window.location.reload();
}
);
}