Check if page is password protected

page.isPasswordProtected()

Check if the page is password protected.

Syntax

page.isPasswordProtected(): Promise<boolean>

Returns

Promise<boolean>

A promise that resolves to a boolean value indicating whether the page is password protected.

Example

// Get Current Page
const currentPage = await webflow.getCurrentPage() as Page
// Check if current page is the homepage
const isPasswordProtected = await currentPage.isPasswordProtected()
if (isPasswordProtected) {
console.log('Current page is PasswordProtected')
} else {
console.log('Current page is not PasswordProtected')
}

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canReadPageSettingsAnyAnyAnyAny