Add logout

This commit is contained in:
Peter Maquiran
2021-05-28 16:24:37 +01:00
parent 5267caaf80
commit a4e3d431fa
2 changed files with 30 additions and 16 deletions
@@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { AnimationController, ModalController } from '@ionic/angular';
import { User } from 'src/app/models/user.model';
import { AuthService } from 'src/app/services/auth.service';
@@ -16,7 +17,8 @@ export class ProfileComponent implements OnInit {
constructor(private modalController:ModalController,
private authService: AuthService,
private animationController: AnimationController) {
private animationController: AnimationController,
private router: Router) {
this.loggeduser = authService.ValidatedUser;
@@ -104,5 +106,9 @@ export class ProfileComponent implements OnInit {
modal.present();
}
logout() {
this.router.navigate(['/']);
}
}