From 10b5abbfdc7b2d6ef6da743b02bc6f3b108df99e Mon Sep 17 00:00:00 2001 From: yauwailam Date: Sat, 8 Feb 2025 15:13:04 +0800 Subject: [PATCH] add google sign in --- Web/Login.html | 136 +++++++++++++++++++++++++++---------------------- 1 file changed, 74 insertions(+), 62 deletions(-) diff --git a/Web/Login.html b/Web/Login.html index 111165b..e7eb62d 100644 --- a/Web/Login.html +++ b/Web/Login.html @@ -6,104 +6,116 @@ Description: login - + - -

Login

+ +

Login

+
+
- -
- - -
-
- - -
- -
- -
- -
-
- - Sign Up - -
- + +
- +
+ + +
+ + + + +
+ +
+
+ +
+
+ Sign Up +
+ +
+ + // if you are testing in live server please add that server domain to the authorized domain if not the pop up will not show up + function signInWithGoogle() { + const provider = new GoogleAuthProvider(); + provider.setCustomParameters({ + prompt: "select_account", // Forces account selection every time + }); + + signInWithPopup(auth, provider) + .then(() => { + errorMessageDiv.classList.add("hidden"); + }) + .catch(() => { + errorMessageDiv.innerHTML = `Google Sign-In failed. Please try again.`; + errorMessageDiv.classList.remove("hidden"); + }); + } + -