From a4e3d431fa384d5450d73e9b385bf5afab113028 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Fri, 28 May 2021 16:24:37 +0100 Subject: [PATCH] Add logout --- .../profile/profile.page.html | 38 +++++++++++-------- .../header-no-search/profile/profile.page.ts | 8 +++- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/src/app/shared/headers/header-no-search/profile/profile.page.html b/src/app/shared/headers/header-no-search/profile/profile.page.html index f962248d5..9f824bf2d 100644 --- a/src/app/shared/headers/header-no-search/profile/profile.page.html +++ b/src/app/shared/headers/header-no-search/profile/profile.page.html @@ -1,16 +1,14 @@ - -
-
Perfil
+
Perfil
- +
@@ -55,18 +53,28 @@ -
- - - Cancelar - - - - - Gravar - - +
+ + + Terminar sessão + + +
+ +
+ + + + Cancelar + + + + + Gravar + + +
\ No newline at end of file diff --git a/src/app/shared/headers/header-no-search/profile/profile.page.ts b/src/app/shared/headers/header-no-search/profile/profile.page.ts index 3f34aebd7..b60974a87 100644 --- a/src/app/shared/headers/header-no-search/profile/profile.page.ts +++ b/src/app/shared/headers/header-no-search/profile/profile.page.ts @@ -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(['/']); + } + }