amenpunk před 3 roky
rodič
revize
0b0fe75be2

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

@@ -54,7 +54,7 @@ export function Build(pwds) {
     return pwds.map(password => {
         let { candidato: user, plaza_id, pwd } = password
         return {
-            pass: pwd,
+            pass: atob( pwd ),
             name: user.nombre,
             apell: user.apellidos,
             mail: user.mail,

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

@@ -13,6 +13,8 @@ import { DesktopDatePicker, LocalizationProvider } from '@mui/lab';
 
 export function Password(props) {
 
+    const [uid,setUID] = React.useState(null);
+
     const PasswordSchema = Yup.object().shape({
         pwd: 
         Yup
@@ -50,14 +52,31 @@ export function Password(props) {
         <FormikProvider style={{ padding : 25, paddingTop : 5 }} value={formik}>
             <Form autoComplete="off" noValidate onSubmit={handleSubmit}>
                 <Stack spacing={3}>
+
                     <TextField
                         fullWidth
                         type="text"
                         label="Nombre o identificador"
                         {...getFieldProps('pwd')}
+                        onChange={(event)=>{
+                            let value = event.target.value
+                            setUID(btoa(value));
+                            setValues({
+                                ...values,
+                                pwd:value
+                            })
+                        }}
                         error={Boolean(touched.pwd && errors.pwd)}
                         helperText={touched.pwd && errors.pwd}
                         />
+                    
+                    <TextField
+                        value={uid? uid: btoa(values.pwd)}
+                        disabled
+                        fullWidth
+                        type="text"
+                        label="Identificador Codificado"
+                        />
 
                     <Stack direction={{ xs: 'column', sm: 'row' }} spacing={2}>
 

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

@@ -63,7 +63,7 @@ export function Resume(props) {
 
         let pwdBody = {
             id: -1,
-            pwd,
+            pwd: btoa(pwd),
             link: "www.psicoadmin.com",
             deadpwd: new Date(deadpwd).toISOString(),
             state: 1,
@@ -128,8 +128,8 @@ export function Resume(props) {
                 <Table>
                     <thead>
                         <tr>
-                            <th>{key.pwd}</th>
-                            <th></th>
+                            <th>{key.pwd}</th>
+                            <th>{btoa(key.pwd)}</th>
                         </tr>
                     </thead>
                     <tbody>