reset pass
This commit is contained in:
@@ -48,10 +48,10 @@
|
||||
<ion-label class="simp_lbl">Code has been sent to the your registered email</ion-label>
|
||||
|
||||
<ion-item lines="none">
|
||||
<ion-input type="email" placeholder="Enter Code"></ion-input>
|
||||
<ion-input type="text" placeholder="Enter Code" [(ngModel)]='reset_pin'></ion-input>
|
||||
</ion-item>
|
||||
|
||||
<ion-button (click)="onPassword()" expand="block">
|
||||
<ion-button (click)="onCompleteReset()" expand="block">
|
||||
Continue
|
||||
</ion-button>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
/*
|
||||
Authors : initappz (Rahul Jograna)
|
||||
Website : https://initappz.com/
|
||||
App Name : E-Learning App Template
|
||||
This App Template Source code is licensed as per the
|
||||
terms found in the Website https://initappz.com/license
|
||||
Copyright and Good Faith Purchasers © 2021-present initappz.
|
||||
*/
|
||||
import { Router } from '@angular/router';
|
||||
import {Component, OnInit, ViewChild} from '@angular/core';
|
||||
import { WrenchService } from 'src/app/services/wrench.service';
|
||||
import { SessionDataProviderService } from 'src/app/store/session-data-provider.service';
|
||||
import { BlogDataService } from 'src/app/store/blog-data.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-forgot',
|
||||
@@ -17,25 +12,146 @@ import {Component, OnInit, ViewChild} from '@angular/core';
|
||||
export class ForgotPage implements OnInit {
|
||||
@ViewChild('username') username;
|
||||
@ViewChild('password') password;
|
||||
@ViewChild('reset_pin') reset_pin;
|
||||
tab = 1
|
||||
reset_uid:string = '';
|
||||
m_uid:string = '';
|
||||
password_reset_id:number = 0;
|
||||
|
||||
constructor(
|
||||
private router: Router
|
||||
) { }
|
||||
private router: Router,
|
||||
private wrenchService: WrenchService,
|
||||
public sessionDataProviderService:SessionDataProviderService,
|
||||
public blogDataService:BlogDataService
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
|
||||
reqData: {
|
||||
'action':11013, email: string, sessionid: string, channel:'MOBILE'
|
||||
};
|
||||
resetResult:any;
|
||||
onEnterEmail(){
|
||||
this.reset_uid = '';
|
||||
this.m_uid = '';
|
||||
if (this.username == null || this.username == '' || this.validateEmail(this.username) == false) {
|
||||
this.showAlert('Invalid Login', 'Enter username(email) to continue');
|
||||
return;
|
||||
}
|
||||
this.tab =3;
|
||||
|
||||
this.reqData = { 'action':11013,email: this.username, sessionid: 'DUMMY-APP-SESSION', channel:'MOBILE' }
|
||||
this.wrenchService.startPassReset(this.reqData).subscribe(
|
||||
resetResult => {
|
||||
this.resetResult = resetResult;
|
||||
console.log("INTERNAL RETURN->" + this.resetResult);
|
||||
/*
|
||||
'm_uid' => string '43c766d9-403d-4125-9983-63c21960b187' (length=36)
|
||||
'password_reset_id' => string '109' (length=3)
|
||||
'reset_uid' => string '48dc78ef-c5c4-4e3a-937c-05f79eeb3f0a' (length=36)
|
||||
'result' => string 'YES I GET TO BACK END' (length=21)
|
||||
'server_name' => string 'https://dev-users.wrenchboard.com' (length=33)
|
||||
'internal_return' => int 0
|
||||
*/
|
||||
if (resetResult != null
|
||||
&& resetResult.internal_return == 0 &&
|
||||
resetResult.password_reset_id > 0 &&
|
||||
resetResult.reset_uid !='' &&
|
||||
resetResult.m_uid != '' ) {
|
||||
this.reset_uid = resetResult.reset_uid;
|
||||
this.m_uid = resetResult.m_uid;
|
||||
this.password_reset_id = resetResult.password_reset_id;
|
||||
this.tab =3;
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("SOME WENT WROMNG");
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
onPassword() {
|
||||
this.router.navigate(['new-password']);
|
||||
}
|
||||
|
||||
verifyData: {
|
||||
'action':730,
|
||||
email: string,
|
||||
sessionid: string,
|
||||
reset_uid: string,
|
||||
m_uid: string,
|
||||
reset_pin: string,
|
||||
step:200,
|
||||
channel:'MOBILE'
|
||||
};
|
||||
/*
|
||||
'sessionid' => string 'DUMMY-CANNOT_BE_EMPTY' (length=21)
|
||||
'reset_link' => string '36dfec6e557768511ffc87bdc861fac4543ae5758f933f8a7c92a7a70960fa3f' (length=64)
|
||||
'newpass' => string 'your-new-password' (length=17)
|
||||
'step' => int 300
|
||||
'action' => int 730
|
||||
|
||||
this.reset_uid = resetResult.reset_uid;
|
||||
this.m_uid = resetResult.m_uid;
|
||||
this.password_reset_id = resetResult.password_reset_id;
|
||||
|
||||
*/
|
||||
onCompleteReset(){
|
||||
|
||||
if (this.username == null || this.username == '' || this.validateEmail(this.username) == false) {
|
||||
this.showAlert('Invalid Login', 'Enter username(email) to continue');
|
||||
return;
|
||||
}
|
||||
|
||||
this.verifyData= {
|
||||
'action':730,
|
||||
email: this.username,
|
||||
sessionid: 'START-SESSION',
|
||||
reset_uid: this.reset_uid,
|
||||
m_uid: this.m_uid,
|
||||
reset_pin: this.reset_pin,
|
||||
step:300,
|
||||
channel:'MOBILE'
|
||||
};
|
||||
|
||||
|
||||
this.wrenchService.verifyPassReset(this.verifyData).subscribe(
|
||||
resetResult => {
|
||||
this.resetResult = resetResult;
|
||||
console.log("INTERNAL RETURN->" + this.resetResult);
|
||||
/*
|
||||
'm_uid' => string '43c766d9-403d-4125-9983-63c21960b187' (length=36)
|
||||
'password_reset_id' => string '109' (length=3)
|
||||
'reset_uid' => string '48dc78ef-c5c4-4e3a-937c-05f79eeb3f0a' (length=36)
|
||||
'result' => string 'YES I GET TO BACK END' (length=21)
|
||||
'server_name' => string 'https://dev-users.wrenchboard.com' (length=33)
|
||||
'internal_return' => int 0
|
||||
*/
|
||||
// if (resetResult != null
|
||||
// && resetResult.internal_return == 0 &&
|
||||
// resetResult.password_reset_id > 0 &&
|
||||
// resetResult.reset_uid !='' &&
|
||||
// resetResult.m_uid != '' ) {
|
||||
// this.reset_uid = resetResult.reset_uid;
|
||||
// this.m_uid = resetResult.m_uid;
|
||||
// this.password_reset_id = resetResult.password_reset_id;
|
||||
// this.tab =3;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// alert("SOME WENT WROMNG");
|
||||
// }
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
onLogin(){
|
||||
this.router.navigate(['login']);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,15 @@ export class WrenchService {
|
||||
);
|
||||
}
|
||||
|
||||
startPassReset(reqData){
|
||||
return this.getPostData('startresetpasword', reqData);
|
||||
//
|
||||
}
|
||||
|
||||
verifyPassReset(reqData){
|
||||
return this.getPostData('stepresetpass', reqData);
|
||||
//
|
||||
}
|
||||
createUser(reqData) {
|
||||
return this.getPostData('createuser', reqData);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user