Question:
The Wix Member App login design is so bad that I want to link to it with a button. I want the login button to appear when I’m logged out, and disappear when I’m logged in.
Product:
Wix Editor, Wix Studio Editor
Question:
The Wix Member App login design is so bad that I want to link to it with a button. I want the login button to appear when I’m logged out, and disappear when I’m logged in.
Product:
Wix Editor, Wix Studio Editor
With a little bit of code, you sure can
Something like:
import { authentication } from "wix-members-frontend";
$w.onReady(function () {
const loggedIn = authentication.loggedIn();
if (loggedIn) {
console.log("Logged in, show the button");
$w("#button").show();
} else {
console.log("Logged out, hide the button");
$w("#button").hide();
}
});
And if you want a login button at the top of every page, place the button inside your page header and add the code to masterPage.js.