Check if page is password protected

page.isPasswordProtected()

Check if the page is password protected.

Syntax

1page.isPasswordProtected(): Promise<boolean>

Returns

Promise<boolean>

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

Example

1// Get Current Page
2const currentPage = await webflow.getCurrentPage() as Page
3
4// Check if current page is the homepage
5const isPasswordProtected = await currentPage.isPasswordProtected()
6
7if (isPasswordProtected) {
8 console.log('Current page is PasswordProtected')
9} else {
10 console.log('Current page is not PasswordProtected')
11}

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canReadPageSettingsAnyAnyAnyAny
Built with