forget Email added
This commit is contained in:
parent
08a9fe2bce
commit
d71932e5e2
@ -30,9 +30,9 @@ export class SessionService {
|
||||
// return this._http.post(this.apiUrl + 'login', {'email':params.email,'password':params.password})
|
||||
}
|
||||
|
||||
resetPasswordApi(forgotDetails,resetPassword): Observable<any> {
|
||||
console.log(forgotDetails,resetPassword)
|
||||
return this._http.post<any>(this.apiUrl + "reset-password/"+forgotDetails.email+'/'+forgotDetails.token,resetPassword)
|
||||
resetPasswordApi(email,token,resetPassword): Observable<any> {
|
||||
console.log(resetPassword)
|
||||
return this._http.post<any>(this.apiUrl + "reset-password/"+email+'/'+token,resetPassword)
|
||||
// return this._http.post(this.apiUrl + 'login', {'email':params.email,'password':params.password})
|
||||
}
|
||||
|
||||
|
||||
@ -26,4 +26,5 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<notifier-container></notifier-container>
|
||||
@ -1,6 +1,7 @@
|
||||
import { Component, OnInit,ViewEncapsulation } from '@angular/core';
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import {Router} from "@angular/router";
|
||||
import { NotifierService } from 'angular-notifier';
|
||||
import { SessionService } from 'app/session-services/session.service';
|
||||
|
||||
@Component({
|
||||
@ -16,7 +17,7 @@ export class ForgotPasswordComponent {
|
||||
form: FormGroup;
|
||||
forgotTokenEmail: any;
|
||||
|
||||
constructor(private router: Router,public _ser:SessionService) { }
|
||||
constructor(private router: Router,public _ser:SessionService,private notifierService: NotifierService,) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.form = new FormGroup({
|
||||
@ -27,13 +28,14 @@ export class ForgotPasswordComponent {
|
||||
submit(){
|
||||
console.log(this.form.value)
|
||||
const mailid = this.form['value'].email.split(/\s/).join('');
|
||||
let forgotMail = {'email':mailid}
|
||||
let forgotMail = {'email':mailid,'urlDomain':window.location.origin}
|
||||
console.log(forgotMail)
|
||||
this._ser.getForgotToken(forgotMail).subscribe(res => {
|
||||
console.log(res)
|
||||
this.forgotTokenEmail = res
|
||||
this._ser.getForgotDetails(this.forgotTokenEmail)
|
||||
this.router.navigate(['authentication/reset-password'])
|
||||
this.notifierService.notify('warning', res.message);
|
||||
//this.router.navigate(['authentication/reset-password'])
|
||||
}, err => {
|
||||
|
||||
//alert(err.message);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { Router } from '@angular/router';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { SessionService } from 'app/session-services/session.service';
|
||||
|
||||
@Component({
|
||||
@ -12,14 +12,17 @@ import { SessionService } from 'app/session-services/session.service';
|
||||
export class ResetPasswordComponent implements OnInit {
|
||||
form: FormGroup;
|
||||
forgotApiDetails: string;
|
||||
|
||||
constructor(private router: Router,public _ser:SessionService) { }
|
||||
email:any=[];
|
||||
token:any = [];
|
||||
constructor(private router: Router,public _ser:SessionService,private route: ActivatedRoute) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
this._ser.name.subscribe(data=>{
|
||||
this.forgotApiDetails = data;
|
||||
console.log(this.forgotApiDetails)
|
||||
});
|
||||
// this._ser.name.subscribe(data=>{
|
||||
// this.forgotApiDetails = data;
|
||||
// console.log(this.forgotApiDetails)
|
||||
// });
|
||||
this.email = this.route.snapshot.paramMap.get('email');
|
||||
this.token = this.route.snapshot.paramMap.get('token');
|
||||
|
||||
this.form = new FormGroup({
|
||||
password: new FormControl('',[Validators.required,Validators.maxLength(10)]),
|
||||
@ -32,7 +35,7 @@ export class ResetPasswordComponent implements OnInit {
|
||||
|
||||
submit(){
|
||||
console.log(this.form.value)
|
||||
this._ser.resetPasswordApi(this.forgotApiDetails,this.form.value).subscribe(res => {
|
||||
this._ser.resetPasswordApi(this.email, this.token ,this.form.value).subscribe(res => {
|
||||
console.log(res)
|
||||
if(res.status == 200){
|
||||
this.router.navigate(['authentication/login'])
|
||||
|
||||
@ -28,7 +28,7 @@ export const SessionRoutes: Routes = [{
|
||||
path: 'otp',
|
||||
component: OtpComponent
|
||||
},{
|
||||
path: 'reset-password',
|
||||
path: 'reset-password/:email/:token',
|
||||
component: ResetPasswordComponent
|
||||
}
|
||||
]
|
||||
|
||||
@ -7,12 +7,12 @@ export const environment = {
|
||||
production: false,
|
||||
environmentName: 'Testing Environment',//Localhost Environment.
|
||||
// apiEndpoint:'http://venbainfotech.com:5000/api/',
|
||||
// apiEndpoint:'http://192.168.1.20:8080/api/',
|
||||
apiEndpoint:'http://192.168.1.19:8080/api/',
|
||||
// apiEndpoint:'https://api.venbait.in/api/',
|
||||
// apiEndpoint:'http://venbainfotech.com:5000/api/',
|
||||
// apiEndpoint:'http://192.168.1.17:8080/api/',
|
||||
|
||||
apiEndpoint:'https://api.venbait.in/api/',
|
||||
// apiEndpoint:'https://api.venbait.in/api/',
|
||||
|
||||
//EndUser URL
|
||||
endUserUrl: window.location.origin+'/#/customer/',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user