Indicates whether the site visitor is a logged-in member.
The loggedIn()
function returns a boolean value
indicating whether the current visitor is logged in as a site member.
If a member is logged in, loggedIn()
returns true
.
Otherwise, loggedIn()
returns false
.
function loggedIn(): boolean;
import { authentication } from "wix-members-frontend";
// ...
const isLoggedIn = authentication.loggedIn();
if (isLoggedIn) {
console.log("Member is logged in");
} else {
console.log("Member is not logged in");
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.