Hi woz,
You can use role api to make your own password customized page for your employees . Get Roles | Velo
You can filter who can view the resources or not using Role API. Beside if you want to add the password tab too, use lightbox or add another section in your restricted page.
Then add (Title , Input , submit button) in the newly added section.
// set the #ContentSection default values to collapsed
$w.onReady(() => {
// First, check if the user is logged in
currentMember.getRoles()
.then((roles) => {
console.log("User roles:", roles);
// Example: check if the user has the "Admin" role
const isAdmin = roles.some(role => role.title === "Admin");
if (isAdmin) {
console.log("User is an Admin");
// Show admin-only elements
$w("#passwordTab").expand();
$w("#ContentSection").collapse();
} else {
console.log("User is NOT an Admin.");
// Hide admin-only elements
$w("#passwordTab").collapse();
$w("#ContentSection").expand();
}
})
.catch((error) => {
console.error("Failed to get roles:", error);
});
const PagePassword = "password12345";
$w("#PasswordSubmitBtn").onClick(() => {
const inputPassword = $w('passwordInput').value;
if(inputPassword === PagePassword) {
$w("#passwordTab").collapse();
$w("#ContentSection").expand();
}else {
$w('#errorMessage').text = "Password is wrong. Please try again!"
}
})
});
You can design the elements in your section as you like with this method!!!
Just to be sure, let me add a note of caution to Mike’s response.
Even for a simple password-protected page like that, you should avoid hardcoding the password directly into the page code, as it’s insecure. Passwords should always be handled and verified on the backend.