loggedIn( )


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.

Method Declaration
Copy
function loggedIn(): boolean;
Request
This method does not take any parameters
Returns
Return Type:boolean
JavaScript
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"); }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?