mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +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>
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ ion-content{
|
|||||||
-o-border-radius: 50px;
|
-o-border-radius: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-content{
|
.main-content {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
@@ -47,11 +48,9 @@ export class LoginPage implements OnInit {
|
|||||||
public alertController: AlertController,
|
public alertController: AlertController,
|
||||||
private modalController: ModalController
|
private modalController: ModalController
|
||||||
//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,7 +105,13 @@ export class LoginPage implements OnInit {
|
|||||||
this.loginRocketChat();
|
this.loginRocketChat();
|
||||||
//this.getToken();
|
//this.getToken();
|
||||||
|
|
||||||
this.router.navigate(['/home/events']);
|
if(!this.pin) {
|
||||||
|
this.setPint = true
|
||||||
|
this.pin = true
|
||||||
|
} else {
|
||||||
|
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"');
|
||||||
@@ -127,7 +130,15 @@ export class LoginPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(this.code.length == 4) {
|
if(this.code.length == 4) {
|
||||||
this.pinLogin()
|
|
||||||
|
const code = this.code.join('')
|
||||||
|
const encrypted = crypto.SHA1(code)
|
||||||
|
|
||||||
|
if(this.setPint) {
|
||||||
|
this.storePin()
|
||||||
|
} else {
|
||||||
|
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