I have a website that is for public mainly but also lists some files that are for a certain select group of people who I will invite to sign up via email. Is it possible to have Login Bar but to hide or remove the signup option that appears if someone is not a member?
How will the website know if they are a member if they haven’t logged themselves in?
You will need a signup form for your select members to be able to register to your site, plus you will then need somewhere for them to login to your website if they wish to view these files etc.
So, you will need a login button or login bar that is on your website for everybody to see as no one will know if any user is a member until they are logged into your website, have this set so that the login option appears first with no link to your signup form.
The only way you can exclude public users from signing up is to have your signup form on a hidden page that only you pass out the address to in your email, therefore only the users that you want to register will be able to register.
thank you so much for the reply once again. I do need the login bar. The problem is the next page that open up after users click on “log in” (see attached pic). I do not know where to find this Log In page so I can edit it. I would only like to remove the signup option there.
import wixUsers from 'wix-users';
import wixLocation from 'wix-location';
import wixWindow from 'wix-window';
$w.onReady(function () {
$w("#forgotPassword").onClick( (event) => {
//wixWindow.lightbox.close()
wixUsers.promptForgotPassword()
.then( ( ) => {
//
} )
.catch( (err) => {
let errorMsg = err; //"The user closed the forgot password dialog"
});
});
});
export function loginButton_click(event) {
let email = $w("#email").value;
let password = $w("#password").value;
wixUsers.login(email, password)
.then( () => {
console.log("User is logged in");
wixLocation.to("/account/my-account"); //Change the URL ending to whatever page you want to send the user to after they log in.
} )
.catch( (err) => {
console.log(err);
$w("#errorMessage").expand(); // You can delete this line if you are not going to add an error message. Use a regular text element set to 'collapse on load' from the Properties Panel.
} );
}
Note that the ‘not a member, need to signup’ text message is just a text element on the lightbox itself that is linked to the signup lightbox and not called through the code above.
We can’t also yet have our own custom forgot password lightbox either, so you have to still call Wix own forgot password window.
This works perfectly for me and it closes automatically after registering details before moving user onto sign in status page, then both names will be saved in contacts and once site member is approved the member details will be added to ‘members’ database.
My signup lightbox code:
import wixUsers from 'wix-users';
import wixWindow from 'wix-window';
import wixLocation from 'wix-location';
$w.onReady(function () {
$w("#registerButton").onClick( (event) => {
let email = $w("#email").value;
let password = $w("#password").value;
let first = $w("#firstName").value;
let last = $w("#lastName").value;
wixUsers.register(email, password, {
contactInfo: {
"firstName": $w('#firstName').value,
"lastName": $w('#lastName').value,
}
} )
.then( (result) => {
let resultStatus = result.status;
wixWindow.lightbox.close();
wixLocation.to("/sign-in-status"); //Change the URL ending to whatever page you want to send the user to after they log in.
} );
} );
});
Note that the ‘already a member, need to login’ text message is just a text element on the lightbox itself that is linked to the login lightbox and not called through the code above.