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>
|
||||
<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="dot" [class.dot-active]="code.length >= 1"></div>
|
||||
<div class="dot" [class.dot-active]="code.length >= 2"></div>
|
||||
|
||||
@@ -126,7 +126,7 @@ ion-content{
|
||||
-o-border-radius: 50px;
|
||||
}
|
||||
|
||||
.main-content{
|
||||
.main-content {
|
||||
background-color: white;
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
|
||||
@@ -33,6 +33,7 @@ export class LoginPage implements OnInit {
|
||||
password: string = environment.defaultuserpwd;
|
||||
userattempt: UserForm;
|
||||
code = []
|
||||
setPint = false
|
||||
|
||||
pin = localStorage.getItem('PIN') != null
|
||||
|
||||
@@ -47,11 +48,9 @@ export class LoginPage implements OnInit {
|
||||
public alertController: AlertController,
|
||||
private modalController: ModalController
|
||||
//private fcm: FCM
|
||||
) { }
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
}
|
||||
ngOnInit() {}
|
||||
|
||||
//Function to validade the login inputs
|
||||
validateInput() {
|
||||
@@ -94,9 +93,7 @@ export class LoginPage implements OnInit {
|
||||
}
|
||||
|
||||
async Login() {
|
||||
/* try { */
|
||||
//Go to our home in home/feed.
|
||||
//this.router.navigate(['/home/events']);
|
||||
|
||||
if (this.validateInput()) {
|
||||
this.userattempt = {
|
||||
username: this.username,
|
||||
@@ -108,7 +105,13 @@ export class LoginPage implements OnInit {
|
||||
this.loginRocketChat();
|
||||
//this.getToken();
|
||||
|
||||
this.router.navigate(['/home/events']);
|
||||
if(!this.pin) {
|
||||
this.setPint = true
|
||||
this.pin = true
|
||||
} else {
|
||||
this.router.navigate(['/home/events']);
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
//this.toastService.presentToast('Não foi possível fazer login"');
|
||||
@@ -127,7 +130,15 @@ export class LoginPage implements OnInit {
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
|
||||
Reference in New Issue
Block a user