rewrote auth.js

This commit is contained in:
Auth
2024-09-14 12:10:08 -04:00
parent c9ce4c1083
commit edc6a5b0d3
2 changed files with 13 additions and 0 deletions

13
auth.js
View File

@@ -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");
}

View File