Prompts the current visitor to log in as a site member.
promptLogin()
returns a Promise that resolves
when the login has completed.
If the visitor cancels the form without logging in, the Promise is rejected.
promptLogin()
can't be called before the page is ready.
Notes:
The frontend Members APIs aren't fully functional when previewing a site. View a published version of a site to see their complete functionality.
The frontend Member APIs can only be used once the page has loaded. Therefore,
you must use them in code that's contained in or is called from the
onReady()
or any element event.
If you return
or await
promptLogin()
when calling from onReady()
, the page is prevented from loading.
To handle the resolved promise, use .then()
and .catch()
.
The options that determine how the login dialog box appears.