You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
toast.success('Link sent to your registered email!')
40
+
letstep=currentStep>=2 ? 2 : currentStep+1
41
+
this.setState({
42
+
currentStep: step
43
+
})
44
+
}
33
45
}
34
46
35
47
handleClose=()=>{
@@ -54,8 +66,8 @@ class Popups extends Component {
54
66
55
67
changePassword=(e)=>{
56
68
e.preventDefault();
57
-
const{ newPass }=this.state;
58
-
const{ auth, changePassword, status}=this.props;
69
+
const{ newPass, success}=this.state;
70
+
const{ auth, changePassword }=this.props;
59
71
60
72
constpassObj={
61
73
password: newPass,
@@ -66,30 +78,21 @@ class Popups extends Component {
66
78
changePassword(passObj);
67
79
68
80
// show notification on sidebar if done successfully
69
-
if(status.success){
81
+
if(success){
70
82
console.log("Successfully changed the password!");
71
83
}
72
84
}
73
85
74
86
forgotPasswordRequest=()=>{
75
87
const{ email }=this.state;
76
-
const{ forgotPassword, status}=this.props;
88
+
const{ forgotPassword }=this.props;
77
89
78
90
console.log("forgot password request sending...")
79
-
forgotPassword(email);
80
-
81
-
let{ currentStep }=this.state;
82
-
// move to next step if forgot password request successful
83
-
if(status.success){
84
-
currentStep=currentStep>=2 ? 2 : currentStep+1
85
-
this.setState({
86
-
currentStep: currentStep
87
-
})
88
-
}else{
89
-
// show error message in popup
90
-
console.log("Something went wrong!!");
91
+
constemailObj={
92
+
email: email
91
93
}
92
-
94
+
this.setState({requested: true})
95
+
forgotPassword(emailObj);
93
96
}
94
97
95
98
@@ -305,12 +308,25 @@ function Step2(props) {
305
308
if(props.currentStep!==2){
306
309
returnnull
307
310
}
308
-
return(
311
+
return(
309
312
<React.Fragment>
310
-
<divclassName="form-group">
311
-
<labelhtmlFor="password">Check your email to get the link of reset the password. If it doesnot appear within few minutes, check the spam folder.</label>
312
-
313
-
</div>
313
+
<ToastContainer
314
+
position="top-right"
315
+
autoClose={5000}
316
+
hideProgressBar={false}
317
+
newestOnTop={false}
318
+
closeOnClick
319
+
rtl={false}
320
+
pauseOnFocusLoss
321
+
draggable
322
+
pauseOnHover
323
+
/>
324
+
<divclassName="form-group">
325
+
<labelhtmlFor="password">
326
+
Check your email to get the link of reset the password. If it doesnot
0 commit comments