reset password
This commit is contained in:
@@ -141,7 +141,7 @@ export class ForgotPage implements OnInit {
|
||||
// this.reset_uid = resetResult.reset_uid;
|
||||
// this.m_uid = resetResult.m_uid;
|
||||
// this.password_reset_id = resetResult.password_reset_id;
|
||||
this.router.navigate(['new-password']);
|
||||
this.router.navigate(['new-password'],{state:resetResult});
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -322,6 +322,7 @@ ion-content {
|
||||
.name {
|
||||
font-family: 'bold';
|
||||
margin-top: 5px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.price {
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
|
||||
<ion-item lines="none">
|
||||
<ion-icon slot="start" name="lock-closed-outline"></ion-icon>
|
||||
<ion-input type="password" placeholder="New Password" maxlength="15"></ion-input>
|
||||
<ion-input type="password" placeholder="New Password" maxlength="15" [(ngModel)]='new_password'></ion-input>
|
||||
</ion-item>
|
||||
|
||||
<ion-item lines="none">
|
||||
<ion-icon slot="start" name="lock-closed-outline"></ion-icon>
|
||||
<ion-input type="password" placeholder="Confirm Password" maxlength="15"></ion-input>
|
||||
<ion-input type="password" placeholder="Confirm Password" maxlength="15" [(ngModel)]='confirm_new_password'></ion-input>
|
||||
</ion-item>
|
||||
|
||||
<ion-button (click)="onCompleteNewReset()" expand="block">
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
*/
|
||||
import { Router } from '@angular/router';
|
||||
import { NavController } from '@ionic/angular';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import {Component, OnInit, ViewChild} from '@angular/core';
|
||||
import {WrenchService} from "../../services/wrench.service";
|
||||
import {SessionDataProviderService} from "../../store/session-data-provider.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-new-password',
|
||||
@@ -16,11 +18,15 @@ import { Component, OnInit } from '@angular/core';
|
||||
styleUrls: ['./new-password.page.scss'],
|
||||
})
|
||||
export class NewPasswordPage implements OnInit {
|
||||
@ViewChild('confirm_new_password') confirm_new_password;
|
||||
@ViewChild('new_password') new_password;
|
||||
|
||||
resetResult;any;
|
||||
constructor(
|
||||
private navctr: NavController,
|
||||
private router: Router
|
||||
private router: Router,
|
||||
private wrenchService: WrenchService,
|
||||
public sessionDataProviderService:SessionDataProviderService
|
||||
) {
|
||||
this.resetResult = this.router.getCurrentNavigation().extras.state;
|
||||
if ( this.resetResult != null
|
||||
@@ -28,9 +34,6 @@ export class NewPasswordPage implements OnInit {
|
||||
this.resetResult.lostpass_id > 0 &&
|
||||
this.resetResult.reset_uid !='' &&
|
||||
this.resetResult.m_uid != '' ) {
|
||||
// this.reset_uid = resetResult.reset_uid;
|
||||
// this.m_uid = resetResult.m_uid;
|
||||
// this.password_reset_id = resetResult.password_reset_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -49,8 +52,50 @@ export class NewPasswordPage implements OnInit {
|
||||
this.router.navigate(['login']);
|
||||
}
|
||||
|
||||
postData: {
|
||||
action:number,
|
||||
step: number,
|
||||
m_uid: string,
|
||||
reset_uid: string,
|
||||
sessionid: string,
|
||||
reset_link: string,
|
||||
channel:'MOBILE',
|
||||
newpass: string
|
||||
};
|
||||
completeResetResults:any;
|
||||
|
||||
onCompleteNewReset(){
|
||||
|
||||
if (this.new_password.length < 8 || (this.new_password != this.confirm_new_password) ){
|
||||
this.showAlert('Error', 'Enter new password to continue');
|
||||
return;
|
||||
}
|
||||
this.postData = {
|
||||
action:730,
|
||||
step: 300,
|
||||
m_uid: this.resetResult.m_uid,
|
||||
reset_uid: this.resetResult.reset_uid,
|
||||
sessionid: 'DUMMY-CANNOT_BE_EMPTY',
|
||||
reset_link: 'DUMMY-CANNOT_BE_EMPTY',
|
||||
channel:'MOBILE',
|
||||
newpass: this.new_password
|
||||
};
|
||||
this.wrenchService.verifyPassReset(this.postData).subscribe(
|
||||
completeResetResults => {
|
||||
this.completeResetResults = completeResetResults;
|
||||
console.log("completeResetResults RETURN->", this.completeResetResults);
|
||||
this.showAlert('Completed', 'Login with new password now');
|
||||
this.router.navigate(['login']);
|
||||
}
|
||||
);
|
||||
}
|
||||
showAlert(mtitle: string, amessage: string) {
|
||||
/* let alert = this.alertCtrl.create({
|
||||
title: mtitle,
|
||||
subTitle: amessage,
|
||||
buttons: ['OK']
|
||||
});
|
||||
alert.present();*/
|
||||
alert(amessage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user