Files
VTHacks-12/auth.js
2024-09-14 12:10:08 -04:00

14 lines
417 B
JavaScript

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