Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meriemno patch 1 #55

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified Backend/database.sqlite
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Backend/images/Ohmyfood1708979757241.png
Binary file added Backend/images/Ohmyfood1709498197127.png
Binary file added Backend/images/Ohmyfood1709499125449.png
Binary file added Backend/images/abajour-tahina1708963552556.png
Binary file added Backend/images/abajour-tahina1708963685317.png
Binary file added Backend/images/abajour-tahina1709499354543.png
Binary file added Backend/images/abajour-tahina1709500828515.png
Binary file added Backend/images/abajour-tahina1709501252229.png
Binary file added Backend/images/abajour-tahina1709501623798.png
Binary file added Backend/images/abajour-tahina1709501850973.png
Binary file added Backend/images/abajour-tahina1709502929418.png
Binary file added Backend/images/abajour-tahina1709503059776.png
Binary file added Backend/images/abajour-tahina1709503099674.png
Binary file added Backend/images/abajour-tahina1709503189922.png
Binary file added Backend/images/bar-lullaby-paris1708963665632.png
Binary file added Backend/images/bar-lullaby-paris1708963728327.png
Binary file added Backend/images/bar-lullaby-paris1709499305172.png
Binary file added Backend/images/bar-lullaby-paris1710292384943.png
Binary file added Backend/images/bar-lullaby-paris1710295960083.png
Binary file added Backend/images/bar-lullaby-paris1710295999928.png
Binary file added Backend/images/bar-lullaby-paris1710296282220.png
Binary file added Backend/images/bar-lullaby-paris1710580377052.png
Binary file added Backend/images/bar-lullaby-paris1710896056307.png
Binary file added Backend/images/bar-lullaby-paris1710896568054.png
Binary file added Backend/images/bar-lullaby-paris1710897027293.png
Binary file added Backend/images/bar-lullaby-paris1710897562219.png
Binary file added Backend/images/bar-lullaby-paris1710980422770.png
Binary file added Backend/images/bar-lullaby-paris1710983196023.png
Binary file added Backend/images/la-balisiere1708963798008.png
Binary file added Backend/images/la-balisiere1709499369952.png
Binary file added Backend/images/la-balisiere1709500879174.png
Binary file added Backend/images/la-balisiere1709501245756.png
Binary file added Backend/images/la-balisiere1709501865919.png
Binary file added Backend/images/la-balisiere1709502747310.png
Binary file added Backend/images/la-balisiere1709502805265.png
Binary file added Backend/images/la-balisiere1709503705323.png
Binary file added Backend/images/la-balisiere1709673649251.png
Binary file added Backend/images/la-balisiere1709673669173.png
Binary file added Backend/images/la-balisiere1709673947177.png
Binary file added Backend/images/la-balisiere1709673983979.png
Binary file added Backend/images/la-balisiere1709673987773.png
Binary file added Backend/images/la-balisiere1709674089343.png
Binary file added Backend/images/la-balisiere1709674174587.png
Binary file added Backend/images/la-balisiere1710292797320.png
Binary file added Backend/images/la-balisiere1710295993090.png
Binary file added Backend/images/la-balisiere1710296276406.png
Binary file added Backend/images/la-balisiere1710896046804.png
Binary file added Backend/images/la-balisiere1710896249976.png
Binary file added Backend/images/la-balisiere1710896944342.png
Binary file added Backend/images/la-balisiere1710897017733.png
Binary file added Backend/images/la-balisiere1710897498746.png
Binary file added Backend/images/la-balisiere1710897540910.png
Binary file added Backend/images/la-balisiere1710897593526.png
Binary file added Backend/images/la-balisiere1710899515691.png
Binary file added Backend/images/la-balisiere1710904209523.png
Binary file added Backend/images/la-balisiere1710977659136.png
Binary file added Backend/images/la-balisiere1710978347245.png
Binary file added Backend/images/la-balisiere1710978370873.png
Binary file added Backend/images/la-balisiere1710979934642.png
Binary file added Backend/images/la-balisiere1710981496353.png
Binary file added Backend/images/la-balisiere1710981521750.png
Binary file added Backend/images/la-balisiere1710983169632.png
Binary file added Backend/images/le-coteau-cassis1709499362801.png
Binary file added Backend/images/le-coteau-cassis1709500766511.png
Binary file added Backend/images/le-coteau-cassis1709501695660.png
Binary file added Backend/images/le-coteau-cassis1709502155511.png
Binary file added Backend/images/le-coteau-cassis1709502792986.png
Binary file added Backend/images/le-coteau-cassis1710295209115.png
Binary file added Backend/images/le-coteau-cassis1710295928175.png
Binary file added Backend/images/le-coteau-cassis1710296313264.png
Binary file added Backend/images/le-coteau-cassis1710894675786.png
Binary file added Backend/images/le-coteau-cassis1710896739063.png
Binary file added Backend/images/le-coteau-cassis1710896873210.png
Binary file added Backend/images/le-coteau-cassis1710903698382.png
Binary file added Backend/images/le-coteau-cassis1710972801267.png
Binary file added Backend/images/le-coteau-cassis1710982122798.png
Binary file added Backend/images/villa-ferneze1710982599845.png
Binary file added Backend/images/villa-ferneze1710983227032.png
3 changes: 3 additions & 0 deletions FrontEnd/assets/icons/picture.svg
Binary file added FrontEnd/assets/images/abajour-tahina.gif
97 changes: 97 additions & 0 deletions FrontEnd/assets/login.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
const emailUser = document.querySelector('#email');
const passwordUser = document.querySelector('#password');
const formulaire = document.querySelector('form');
const message = document.querySelector('form .erreur');
const loged = window.localStorage.loged;




async function validateForm() {


formulaire.addEventListener('submit', async (event) => {


event.preventDefault();
//declarer les variables et recuperer la saisi
let email = emailUser.value;
let password = passwordUser.value;
//affichage console

//verification coté client
if (!email || !password) {
// Gérer l'erreur de validation, par exemple, afficher un message à l'utilisateur
console.log('Veuillez remplir tous les champs obligatoires.');
message.textContent = 'Veuillez remplir tous les champs obligatoires.';
return;
}


try {
//fetch post

const response = await fetch('http://localhost:5678/api/users/login', {

method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: email,
password: password
})
})

if (!response.ok) {

message.textContent = 'Erreur dans l’identifiant ou le mot de passe';
message.style.color = 'red';
window.localStorage.removeItem('token');
window.sessionStorage.removeItem('token');
return;
}

const data = await response.json();
console.log(data);

if (data.token) {

//redirection vers la page d'accueil en mode creation
window.sessionStorage.loged = true;
window.sessionStorage.accessToken = data.token;

window.location.href = 'index.html';
}

} catch (error) {

if (error instanceof TypeError) {
// La requête a échoué car le service n'est pas joignable
console.log('Le service n\'est pas joignable. Veuillez réessayer plus tard.');
message.textContent = 'Le service n\'est pas joignable. Veuillez réessayer plus tard.'

} else {
// Une autre erreur s'est produite
console.log('Une erreur inattendue s\'est produite:', error);
message.textContent = 'Une erreur inattendue s\'est produite.'


}

}


})

}


function init() {

validateForm();

}

init();
Loading