diff --git a/js/index.js b/js/index.js
index ee6a39a..b6dbdc8 100644
--- a/js/index.js
+++ b/js/index.js
@@ -1,9 +1,7 @@
let pin = "";
-let pass = "";
$(document).ready(function () {
FastClick.attach(document.body);
- if(!localStorage.getItem('user')) localStorage.setItem('user', user);
setEvents();
});
@@ -14,13 +12,15 @@ function setEvents() {
Swal.fire({
title: 'Iniciar sesión',
html:
- '',
+ `
+ `,
confirmButtonText: 'Login',
showCloseButton: true,
showCancelButton: false,
}).then(async (result) => {
if(result.isConfirmed) {
- pass = $('#pass').val();
+ const user = $('#user').val();
+ const pass = $('#pass').val();
signIn(user,pass);
}
});
@@ -64,6 +64,7 @@ function signIn(user, password) {
success: function (data) {
localStorage.setItem("token", data.token);
localStorage.setItem("ttl", data.ttl);
+ localStorage.setItem("user", user);
localStorage.setItem("password", password);
localStorage.setItem("created", Date.now());
getTokenConfig();
diff --git a/js/main.js b/js/main.js
index bf6dda0..2919bc6 100644
--- a/js/main.js
+++ b/js/main.js
@@ -1,4 +1,3 @@
-const user = "timeControl";
const renewPeriod = localStorage.getItem('renewPeriod');
let intervalId, isCheckingToken;