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