From edc6a5b0d3de405a46b156a72216b442284082b7 Mon Sep 17 00:00:00 2001 From: Auth <93170896+AuthGithub@users.noreply.github.com> Date: Sat, 14 Sep 2024 12:10:08 -0400 Subject: [PATCH] rewrote auth.js --- auth.js | 13 +++++++++++++ authuser.js | 0 2 files changed, 13 insertions(+) delete mode 100644 authuser.js diff --git a/auth.js b/auth.js index e69de29..5039ebc 100644 --- a/auth.js +++ b/auth.js @@ -0,0 +1,13 @@ +import { createClient } from "@propelauth/javascript"; + +const authClient = createClient({ + authUrl: "http://localhost:3000", // Replace with your actual auth URL + enableBackgroundTokenRefresh: true // Optional +}); + +const authInfo = await authClient.getAuthenticationInfoOrNull(); +if (authInfo) { + console.log("User is logged in as", authInfo.user.email); +} else { + console.log("User is not logged in"); +} diff --git a/authuser.js b/authuser.js deleted file mode 100644 index e69de29..0000000