-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGetPasswordCode.js
More file actions
165 lines (137 loc) · 5.54 KB
/
Copy pathGetPasswordCode.js
File metadata and controls
165 lines (137 loc) · 5.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
import React, {useEffect, useState} from 'react';
import Avatar from '@material-ui/core/Avatar';
import Button from '@material-ui/core/Button';
import CssBaseline from '@material-ui/core/CssBaseline';
import TextField from '@material-ui/core/TextField';
import Link from '@material-ui/core/Link';
import Grid from '@material-ui/core/Grid';
import Box from '@material-ui/core/Box';
import Typography from '@material-ui/core/Typography';
import { makeStyles } from '@material-ui/core/styles';
import Container from '@material-ui/core/Container';
import VpnKeyIcon from '@material-ui/icons/VpnKey';
import {useHistory} from "react-router-dom";
import axios from "axios";
function Copyright() {
return (
<Typography variant="body2" color="textSecondary" align="center">
{'Copyright © '}
<Link color="inherit" href="/#">
Recce Labs (PVT) Ltd
</Link>{' '}
{new Date().getFullYear()}
{'.'}
</Typography>
);
}
const useStyles = makeStyles((theme) => ({
paper: {
marginTop: theme.spacing(8),
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
},
avatar: {
margin: theme.spacing(1),
backgroundColor: theme.palette.secondary.main,
},
form: {
width: '100%', // Fix IE 11 issue.
marginTop: theme.spacing(3),
},
submit: {
margin: theme.spacing(3, 0, 2),
},
}));
export default function GetPasswordCode() {
const classes = useStyles();
const history = useHistory();
const [firstName,setFirstName]=useState("")
useEffect(()=>{},[firstName])
const [lastName,setLastName]=useState("")
useEffect(()=>{},[lastName])
const [email,setEmail]=useState("")
useEffect(()=>{},[email])
const [password,setPassword]=useState("")
useEffect(()=>{},[password])
const [confirmCode,setConfirmCode]=useState("")
useEffect(()=>{},[confirmCode])
const handleClick = (e) => {
e.preventDefault()
console.log(confirmCode)
console.log(typeof (confirmCode))
console.log(typeof (window.localStorage.getItem('code')))
console.log( (window.localStorage.getItem('code')))
if(confirmCode===window.localStorage.getItem('code')){
console.log("Valid Code")
history.push("/reset-password")
}
else{
window.location =("/get-password-code")
}
}
return (
<Container component="main" maxWidth="xs">
<CssBaseline />
<div className={classes.paper}>
<Avatar className={classes.avatar}>
<VpnKeyIcon/>
</Avatar>
<Typography component="h1" variant="h5">
Confirm Code to Reset The Password
</Typography>
<br/>
<br/>
<Grid item xs={12} >
<h5 style={{justifyContent: 'center'}}>Enter The Confirmation Code that We send to Your Previous Email Address </h5>
<h5 style={{justifyContent: 'center'}}>Please Check Your Email & Enter The Code Confirmation Code Here !</h5>
</Grid>
<form className={classes.form} noValidate>
<Grid container spacing={2}>
<Grid item xs={12}>
<TextField
variant="outlined"
required
fullWidth
id="confirmCode"
label="Enter Your Confirmation Code"
name="confirmCode"
autoComplete="confirmCode"
value={confirmCode}
onChange={e => setConfirmCode(e.target.value)}
/>
</Grid>
<Grid item xs={12}>
{/*<FormControlLabel*/}
{/* control={<Checkbox value="allowExtraEmails" color="primary" />}*/}
{/* label="I want to receive inspiration, marketing promotions and updates via email."*/}
{/*/>*/}
</Grid>
</Grid>
<div style={{justifyContent: 'center'}}>
<Button
style={{maxWidth:"200px",marginRight:"20px",marginLeft:"140px",justifyContent: 'center'}}
type="submit"
variant="contained"
color="primary"
className={classes.submit}
onClick={handleClick}
>
Confirm Code
</Button>
</div>
<Grid container justify="flex-end">
{/*<Grid item xs>*/}
{/* <Link href="/sign-in" variant="body2">*/}
{/* Already have an account? Sign in*/}
{/* </Link>*/}
{/*</Grid>*/}
</Grid>
</form>
</div>
<Box mt={5}>
<Copyright />
</Box>
</Container>
);
}