Search...
logout( )
Logs the current member out of the site.
Description
The logout()
function logs the current member out of the site.
Notes:
The APIs in
wix-members-frontend
are only partially functional when previewing your site. View a published version of your site to see their complete functionality.The APIs in
wix-members-frontend
can only be used once the page has loaded. Therefore, you must use them in code that is contained in or is called from the onReady() event handler or any element event handler.
Syntax
function logout(): void
logout Parameters
This function does not take any parameters.
Returns
This function does not return anything.
Return Type:
void
Was this helpful?
Log the current member out
Copy Code
1import { authentication } from 'wix-members-frontend';23// ...45authentication.logout();
Log the current member out when they click a button
Copy Code
1import { authentication } from 'wix-members-frontend';23// ...45$w('#logout').onClick(() => {6 authentication.logout();7});