github_auth presque integre (implementation pas finis)

This commit is contained in:
2026-01-12 19:25:26 +01:00
parent d43b239e2f
commit 9cb97ca183
4 changed files with 25 additions and 1 deletions
+14 -1
View File
@@ -4,7 +4,7 @@ export class LoginWindow extends fenetre {
constructor() {
super(320, 240, "Connexion");
this.mode = "login"; // login | register
this.mode = "login";
this.username = document.createElement("input");
this.username.placeholder = "Username";
@@ -33,6 +33,19 @@ export class LoginWindow extends fenetre {
this.applyStyles();
this.bindEvents();
// **** AJOUT FONCTION GITHUB ****
// Dans constructor() de LoginWindow
this.githubBtn = document.createElement("button");
this.githubBtn.innerText = "Se connecter avec GitHub";
this.githubBtn.style.backgroundColor = "#24292e";
this.githubBtn.style.color = "white";
this.githubBtn.onclick = () => {
window.location.href = "/api/auth/github";
};
this.body.appendChild(this.githubBtn);
this.checkIfAlreadyLoggedIn(); //verifie si l'utilisateur est connecté au démarrage
}