Files
VTHacks-12/auth.js
2024-09-14 17:51:33 -04:00

14 lines
424 B
JavaScript

import { createClient } from "@propelauth/javascript";
const authClient = createClient({
authUrl: "https://auth.fooddecisive.co", // 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");
}