Revue JS frontend formulaire inscription : pas de redirection mais info si déjà connecté
This commit is contained in:
parent
cf9bfa559e
commit
a078795178
|
@ -14,7 +14,7 @@ const configUsers = require("../../config/users");// idem pour configurer formul
|
||||||
// Importation des fonctions utiles au script :
|
// Importation des fonctions utiles au script :
|
||||||
import { getLocaly, removeLocaly, saveLocaly } from "./tools/clientstorage.js";
|
import { getLocaly, removeLocaly, saveLocaly } from "./tools/clientstorage.js";
|
||||||
import { addElement } from "./tools/dom.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 { getDatasFromInputs, setAttributesToInputs } from "./tools/forms.js";
|
||||||
import { loadMatomo } from "./tools/matomo.js";
|
import { loadMatomo } from "./tools/matomo.js";
|
||||||
import { checkAnswerDatas, checkSession, getTimeDifference } from "./tools/users.js";
|
import { checkAnswerDatas, checkSession, getTimeDifference } from "./tools/users.js";
|
||||||
|
@ -37,10 +37,11 @@ const initialise = async () =>
|
||||||
const isConnected=await checkSession();
|
const isConnected=await checkSession();
|
||||||
if(isConnected)
|
if(isConnected)
|
||||||
{
|
{
|
||||||
saveLocaly("message", { message: alreadyConnected, color:"info" });
|
// on change le lien d'accès au compte
|
||||||
const user=getLocaly("user", true);
|
const user=getLocaly("user", true);
|
||||||
const homePage=user.status+"HomePage";
|
updateAccountLink(user.status, configTemplate);
|
||||||
window.location.assign("/"+configTemplate[homePage]);
|
myForm.style.display="block";
|
||||||
|
myForm.innerHTML="<p class='info'>"+alreadyConnected+"</p>";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue