Skip to content
Snippets Groups Projects
Commit f0806ffe authored by Mamadu-lamarana Bah's avatar Mamadu-lamarana Bah :speech_balloon:
Browse files

admin

parent 5e936fa3
No related branches found
No related tags found
No related merge requests found
......@@ -5,11 +5,10 @@
<title>login/register</title>
<link rel="stylesheet" type="text/css" href="/stylesheets/style.css"/>
<script src="../scripts/login.client.js" defer="true"/></script>
</head>
<body>
<h1>Exemple pour JWT</h1>
<h1>Application de partage</h1>
<div id="userdata">
<div>
......
......@@ -5,7 +5,6 @@
<title>login/register</title>
<link rel="stylesheet" type="text/css" href="/stylesheets/style.css"/>
<script src="../scripts/register.client.js" defer="true"/></script>
</head>
<body>
......
......@@ -5,11 +5,10 @@
<title>user profile</title>
<link rel="stylesheet" type="text/css" href="/stylesheets/style.css"/>
<script src="../scripts/user.client.js" defer="true"/></script>
</head>
<body>
<h1>Information utilisateur</h1>
<h1>Zone utilisateur</h1>
<p>
utilisateur connecté
</p>
......
......@@ -19,8 +19,13 @@ const login = async () => {
const response = await fetch(`/access/login`, requestOptions);
if (response.ok) {
const loggedUser = await response.json();
if(userlogin.value === 'admin') {
window.location.href = '/admin'
}
else {
window.location.href = '/user';
}
}
else {
const error = await response.json();
document.getElementById('problem').textContent = `erreur : ${error.message}`;
......
......@@ -33,6 +33,7 @@ app.use(express.static(path.join(__dirname, 'public')));
app.use('/', indexRouter);
app.use('/access', accessRouter);
app.use('/user', userRouter);
// app.use('admin', adminRouter);
// error handler
app.use(error);
......
......@@ -5,11 +5,10 @@
<title>login/register</title>
<link rel="stylesheet" type="text/css" href="/stylesheets/style.css"/>
<script src="../scripts/login.client.js" defer="true"/></script>
<script defer src="../scripts/login-bundle.js?182aae2fcdba49183358"></script></head>
<script defer src="../scripts/login-bundle.js?2fdaa64ac97644d8c6a5"></script></head>
<body>
<h1>Exemple pour JWT</h1>
<h1>Application de partage</h1>
<div id="userdata">
<div>
......
......@@ -5,8 +5,7 @@
<title>login/register</title>
<link rel="stylesheet" type="text/css" href="/stylesheets/style.css"/>
<script src="../scripts/register.client.js" defer="true"/></script>
<script defer src="../scripts/register-bundle.js?182aae2fcdba49183358"></script></head>
<script defer src="../scripts/register-bundle.js?2fdaa64ac97644d8c6a5"></script></head>
<body>
<h1>Identification</h1>
......
......@@ -5,11 +5,10 @@
<title>user profile</title>
<link rel="stylesheet" type="text/css" href="/stylesheets/style.css"/>
<script src="../scripts/user.client.js" defer="true"/></script>
<script defer src="../scripts/user-bundle.js?182aae2fcdba49183358"></script></head>
<script defer src="../scripts/user-bundle.js?2fdaa64ac97644d8c6a5"></script></head>
<body>
<h1>Information utilisateur</h1>
<h1>Zone utilisateur</h1>
<p>
utilisateur connecté
</p>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment