Revue JS frontend formulaire inscription : pas de redirection mais info si déjà connecté

This commit is contained in:
Fabrice PENHOËT 2020-11-30 17:04:58 +01:00
parent cf9bfa559e
commit a078795178

View File

@ -14,7 +14,7 @@ const configUsers = require("../../config/users");// idem pour configurer formul
// Importation des fonctions utiles au script :
import { getLocaly, removeLocaly, saveLocaly } from "./tools/clientstorage.js";
import { addElement } from "./tools/dom.js";
import { helloDev } from "./tools/everywhere.js";
import { helloDev, updateAccountLink } from "./tools/everywhere.js";
import { getDatasFromInputs, setAttributesToInputs } from "./tools/forms.js";
import { loadMatomo } from "./tools/matomo.js";
import { checkAnswerDatas, checkSession, getTimeDifference } from "./tools/users.js";
@ -37,10 +37,11 @@ const initialise = async () =>
const isConnected=await checkSession();
if(isConnected)
{
saveLocaly("message", { message: alreadyConnected, color:"info" });
// on change le lien d'accès au compte
const user=getLocaly("user", true);
const homePage=user.status+"HomePage";
window.location.assign("/"+configTemplate[homePage]);
updateAccountLink(user.status, configTemplate);
myForm.style.display="block";
myForm.innerHTML="<p class='info'>"+alreadyConnected+"</p>";
}
else
{