Browse Source

pwd as base64

amenpunk 2 years ago
parent
commit
0b0fe75be2

+ 1 - 1
src/Components/Password/Rows.js

54
     return pwds.map(password => {
54
     return pwds.map(password => {
55
         let { candidato: user, plaza_id, pwd } = password
55
         let { candidato: user, plaza_id, pwd } = password
56
         return {
56
         return {
57
-            pass: pwd,
57
+            pass: atob( pwd ),
58
             name: user.nombre,
58
             name: user.nombre,
59
             apell: user.apellidos,
59
             apell: user.apellidos,
60
             mail: user.mail,
60
             mail: user.mail,

+ 19 - 0
src/Components/Password/Steps/password.jsx

13
 
13
 
14
 export function Password(props) {
14
 export function Password(props) {
15
 
15
 
16
+    const [uid,setUID] = React.useState(null);
17
+
16
     const PasswordSchema = Yup.object().shape({
18
     const PasswordSchema = Yup.object().shape({
17
         pwd: 
19
         pwd: 
18
         Yup
20
         Yup
50
         <FormikProvider style={{ padding : 25, paddingTop : 5 }} value={formik}>
52
         <FormikProvider style={{ padding : 25, paddingTop : 5 }} value={formik}>
51
             <Form autoComplete="off" noValidate onSubmit={handleSubmit}>
53
             <Form autoComplete="off" noValidate onSubmit={handleSubmit}>
52
                 <Stack spacing={3}>
54
                 <Stack spacing={3}>
55
+
53
                     <TextField
56
                     <TextField
54
                         fullWidth
57
                         fullWidth
55
                         type="text"
58
                         type="text"
56
                         label="Nombre o identificador"
59
                         label="Nombre o identificador"
57
                         {...getFieldProps('pwd')}
60
                         {...getFieldProps('pwd')}
61
+                        onChange={(event)=>{
62
+                            let value = event.target.value
63
+                            setUID(btoa(value));
64
+                            setValues({
65
+                                ...values,
66
+                                pwd:value
67
+                            })
68
+                        }}
58
                         error={Boolean(touched.pwd && errors.pwd)}
69
                         error={Boolean(touched.pwd && errors.pwd)}
59
                         helperText={touched.pwd && errors.pwd}
70
                         helperText={touched.pwd && errors.pwd}
60
                         />
71
                         />
72
+                    
73
+                    <TextField
74
+                        value={uid? uid: btoa(values.pwd)}
75
+                        disabled
76
+                        fullWidth
77
+                        type="text"
78
+                        label="Identificador Codificado"
79
+                        />
61
 
80
 
62
                     <Stack direction={{ xs: 'column', sm: 'row' }} spacing={2}>
81
                     <Stack direction={{ xs: 'column', sm: 'row' }} spacing={2}>
63
 
82
 

+ 3 - 3
src/Components/Password/Steps/resume.jsx

63
 
63
 
64
         let pwdBody = {
64
         let pwdBody = {
65
             id: -1,
65
             id: -1,
66
-            pwd,
66
+            pwd: btoa(pwd),
67
             link: "www.psicoadmin.com",
67
             link: "www.psicoadmin.com",
68
             deadpwd: new Date(deadpwd).toISOString(),
68
             deadpwd: new Date(deadpwd).toISOString(),
69
             state: 1,
69
             state: 1,
128
                 <Table>
128
                 <Table>
129
                     <thead>
129
                     <thead>
130
                         <tr>
130
                         <tr>
131
-                            <th>{key.pwd}</th>
131
+                            <th>{key.pwd}</th>
132
-                            <th></th>
132
+                            <th>{btoa(key.pwd)}</th>
133
                         </tr>
133
                         </tr>
134
                     </thead>
134
                     </thead>
135
                     <tbody>
135
                     <tbody>