mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
Messages
This commit is contained in:
@@ -26,7 +26,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<ion-title class="title">Digite o PIN novo</ion-title>
|
<ion-title *ngIf="!setPint" class="title">Digite o PIN</ion-title>
|
||||||
|
<ion-title *ngIf="setPint" class="title">Digite o novo PIN</ion-title>
|
||||||
|
|
||||||
<div class="d-flex pt-25 align-center justify-center">
|
<div class="d-flex pt-25 align-center justify-center">
|
||||||
<div class="dot" [class.dot-active]="code.length >= 1"></div>
|
<div class="dot" [class.dot-active]="code.length >= 1"></div>
|
||||||
<div class="dot" [class.dot-active]="code.length >= 2"></div>
|
<div class="dot" [class.dot-active]="code.length >= 2"></div>
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ export class LoginPage implements OnInit {
|
|||||||
password: string = environment.defaultuserpwd;
|
password: string = environment.defaultuserpwd;
|
||||||
userattempt: UserForm;
|
userattempt: UserForm;
|
||||||
code = []
|
code = []
|
||||||
|
setPint = false
|
||||||
|
|
||||||
pin = localStorage.getItem('PIN') != null
|
pin = localStorage.getItem('PIN') != null
|
||||||
|
|
||||||
@@ -49,9 +50,7 @@ export class LoginPage implements OnInit {
|
|||||||
//private fcm: FCM
|
//private fcm: FCM
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//Function to validade the login inputs
|
//Function to validade the login inputs
|
||||||
validateInput() {
|
validateInput() {
|
||||||
@@ -94,9 +93,7 @@ export class LoginPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async Login() {
|
async Login() {
|
||||||
/* try { */
|
|
||||||
//Go to our home in home/feed.
|
|
||||||
//this.router.navigate(['/home/events']);
|
|
||||||
if (this.validateInput()) {
|
if (this.validateInput()) {
|
||||||
this.userattempt = {
|
this.userattempt = {
|
||||||
username: this.username,
|
username: this.username,
|
||||||
@@ -108,8 +105,14 @@ export class LoginPage implements OnInit {
|
|||||||
this.loginRocketChat();
|
this.loginRocketChat();
|
||||||
//this.getToken();
|
//this.getToken();
|
||||||
|
|
||||||
|
if(!this.pin) {
|
||||||
|
this.setPint = true
|
||||||
|
this.pin = true
|
||||||
|
} else {
|
||||||
this.router.navigate(['/home/events']);
|
this.router.navigate(['/home/events']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
//this.toastService.presentToast('Não foi possível fazer login"');
|
//this.toastService.presentToast('Não foi possível fazer login"');
|
||||||
this.presentAlert('O nome de utilizador e palavra-passe estão incorretas ou verifique a sua conexão com a internet e volte a tentar.');
|
this.presentAlert('O nome de utilizador e palavra-passe estão incorretas ou verifique a sua conexão com a internet e volte a tentar.');
|
||||||
@@ -127,8 +130,16 @@ export class LoginPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(this.code.length == 4) {
|
if(this.code.length == 4) {
|
||||||
|
|
||||||
|
const code = this.code.join('')
|
||||||
|
const encrypted = crypto.SHA1(code)
|
||||||
|
|
||||||
|
if(this.setPint) {
|
||||||
|
this.storePin()
|
||||||
|
} else {
|
||||||
this.pinLogin()
|
this.pinLogin()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,6 +162,16 @@ export class LoginPage implements OnInit {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
storePin() {
|
||||||
|
const code = this.code.join('')
|
||||||
|
const encrypted = crypto.SHA1(code)
|
||||||
|
|
||||||
|
localStorage.setItem('PIN', encrypted)
|
||||||
|
|
||||||
|
this.router.navigate(['/home/events']);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
async successMessage(message?: string) {
|
async successMessage(message?: string) {
|
||||||
|
|
||||||
const modal = await this.modalController.create({
|
const modal = await this.modalController.create({
|
||||||
|
|||||||
Reference in New Issue
Block a user