From a4e3d431fa384d5450d73e9b385bf5afab113028 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Fri, 28 May 2021 16:24:37 +0100 Subject: [PATCH 1/2] 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(['/']); + } + } From f709e6f541b0b2c7023375e9990a5e221f665ca7 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Fri, 28 May 2021 16:25:42 +0100 Subject: [PATCH 2/2] Improve login --- src/app/pages/login/login.page.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index 2c910f7d3..43ceadb5f 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -142,7 +142,7 @@ export class LoginPage implements OnInit { const encrypted = crypto.SHA1(code) if( encrypted == localStorage.getItem('PIN')) { - this.successMessage() + //this.successMessage() this.router.navigate(['/home/events']); } else { this.badRequest()