From a8d74fcb25dab466a0d1835c5a3aec7d64db096d Mon Sep 17 00:00:00 2001 From: NOOB-3301 Date: Tue, 31 Dec 2024 12:05:46 +0530 Subject: [PATCH 1/3] added firebase auth --- .vscode/settings.json | 2 + index2.html | 27 +++++ login.html | 223 ++++++++++++++++++++++++++++++++++++--- register.html | 239 +++++++++++++++++++++++++++++++++++++++--- 4 files changed, 463 insertions(+), 28 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/index2.html b/index2.html index eaff25e..515d8c1 100644 --- a/index2.html +++ b/index2.html @@ -301,6 +301,33 @@

${job['Job Title']}

} + + diff --git a/login.html b/login.html index 3692fd1..8272f50 100644 --- a/login.html +++ b/login.html @@ -234,44 +234,237 @@

Ajivika Access

- + +
+
Don’t have an account? Register here
- - - - - + + + + +
- + + + + + + + diff --git a/register.html b/register.html index 5568f65..79d06c6 100644 --- a/register.html +++ b/register.html @@ -229,30 +229,64 @@

Start with Ajivika

- + +
- + +
- + +
- - - - - + + + + +
+ - + + + + + + From 366236c724c1b08236ce44d6463745e69459e3d4 Mon Sep 17 00:00:00 2001 From: NOOB-3301 Date: Tue, 31 Dec 2024 14:30:04 +0530 Subject: [PATCH 2/3] supabse auth --- index2.html | 51 +++++++++-------- login.html | 83 ++++++++++++++------------- register.html | 153 +++++++++++++++++++++++++------------------------- 3 files changed, 145 insertions(+), 142 deletions(-) diff --git a/index2.html b/index2.html index 515d8c1..cb750ad 100644 --- a/index2.html +++ b/index2.html @@ -302,32 +302,35 @@

${job['Job Title']}

- + } + + // Run the auth state check on page load + checkAuthState(); + + diff --git a/login.html b/login.html index 8272f50..53308e0 100644 --- a/login.html +++ b/login.html @@ -265,34 +265,30 @@

Ajivika Access

+ + + - --> - --> diff --git a/register.html b/register.html index 79d06c6..0272c5b 100644 --- a/register.html +++ b/register.html @@ -266,99 +266,100 @@

Start with Ajivika

- + + + - --> - --> From 05012a74967cd0e836f17be1ca6162fcf543b328 Mon Sep 17 00:00:00 2001 From: NOOB-3301 Date: Tue, 31 Dec 2024 16:29:39 +0530 Subject: [PATCH 3/3] added supabase google,github --- login.html | 187 ++++++++++++++++++++------------------------------ register.html | 184 ++++++++++++++++++++----------------------------- 2 files changed, 148 insertions(+), 223 deletions(-) diff --git a/login.html b/login.html index 53308e0..0ab4c77 100644 --- a/login.html +++ b/login.html @@ -338,132 +338,95 @@

Ajivika Access

- - - + + diff --git a/register.html b/register.html index 0272c5b..761b641 100644 --- a/register.html +++ b/register.html @@ -359,132 +359,94 @@

Start with Ajivika

- - - - + --> + // Facebook button event listener + const FBbutton = document.getElementById("facebook"); + + FBbutton.addEventListener("click", async () => { + try { + const { data, error } = await supabase3.auth.signInWithOAuth({ + provider: "facebook", // Specify the provider + options: { + redirectTo: "https://your-domain.com/index2.html" // Replace with your redirect URI + } + }); + + if (error) throw error; + + console.log("Redirecting to Facebook sign-in page:", data); + } catch (error) { + console.error("Facebook sign-in error:", error.message); + } + }); + + // Check authentication state + const session = await supabase3.auth.getSession(); + if (session.data.session) { + console.log("User is signed in:", session.data.session.user); + window.location.href = "/index2.html"; + } else { + console.log("No user signed in"); + } +