account-react-eurekasigma
v2.0.1
Published
```shell npm install account-react-eurekasigma ```
Downloads
516
Readme
Componente AccountEurekaSigma v1.6.0
Instalación
npm install account-react-eurekasigma
Configuración del componente
El componente AccountEurekaSigma recibe un valor el cual se nombra como config, este un JSON (Javascript Object Notation) para que cada proyecto pueda adaptarlo a sus preferencias, en seguida se muestra los paramatros que podría utilizar para configurar el componente.
{
logo: 'https:://logo/logo.jpg', // (string) La URL al logo del proyecto
logoFooter: 'https:://logo/logo.jpg', // (string) La URL al logo del proyecto pero que se colocara en la parte inferior
colorPrincipal: '#FFF', // (string) Un hexadecimal del color para el componente principal
colorSecundario: '#FFF', // (string) Un hexadecimal del color para los botones del componente principal
colorTexto: '#FFF', // (string) Un hexadecimal del color de texto para el componente principal
inactivo: 0, // (int) Este valor puede ser 1 o 0 y representa si la sesión debe terminar
key: 'token', // (string) El token del proyecto para poder utilizar tu base de datos CRUFDEK
tabla: 'EurekaAcUsuario' // (string) El nombre de la tabla donde se almacenan los usuarios
aceptaRegistros: 1, // (int) Este valor representa si tu App acepta registros puede ser 1 o 0
redireccion: 'dominio/procesar', // (string) La URL donde se procesan tus credenciales
serviciosAccesoMostrar: ['google',...] // (array) los servicios de acceso con los cuales se puede iniciar sesión
}
Funciones Adicionales
Este paquete cuenta con funciones que podrían ayudar al manejo de la sesión las cuales se listan en seguida:
- crearCookie
- eliminarCookie
- obtenerCookie
- configurarContadorInactividad
función crearCookie
Esta función recibe tres parámetros nombre (string), valor (string|int|object), seEncripta (bool) y especifican como se llamara la cookie, el dato que se le va a dar y si se encriptara, configTiempoExp (object) este json contiene un valor llamado tiempo (int) el cual especifica el tiempo a requerir y un valor llamado tipo (string) el cual puede ser minuto, hora, dia este valor especifica como será procesada el tiempo de expiracion 1 minuto, 45 dias, 4 horas, por ejemplo.
función elimnarCookie
Esta función recibe solamente nombre para determinar cual cookie hay que destruir.
función obtenerCookie
Esta función recupera el valor de la cookie y esta recibe dos parámetros nombre (string) y seEncripto (bool).
función configurarContadorInactividad
Esta funcón ayuda a manejar la inactividad en la aplicación, esta recibe dos parámetros tiempo (int) y url (string), el primero especifica el tiempo antes de que se produzca una inactividad este valor se representa en minutos (1 = un minuto), el parámetro url es la redirreción para cerrar la sesión dentro de tu app.
función refrescarToken
Esta función te ayuda a refrescar el token para seguir manteniendo tu sesión activa la funcion recibe el token antiguo que estas utilizando en tu aplicacion, esta función te regresará un nuevo token y caducara el anterior de ser necesario.