blockByEmail( )


Blocks a member from logging in to the site.

The blockByEmail() function returns a Promise that resolves when the specified member is blocked.

To unblock the member and allow them to log in to the site, use approveByEmail().

Method Declaration
Copy
function blockByEmail(email: string): Promise<void>;
Method Parameters
emailstringRequired

Login email address of the member to block.

Block a member
JavaScript
import { Permissions, webMethod } from "wix-web-module"; import { authentication } from "wix-members-backend"; export const myBlockByEmailFunction = webMethod(Permissions.Anyone, (email) => { return authentication .blockByEmail(email) .then(() => { console.log("Email blocked from site membership"); }) .catch((error) => { console.error(error); }); });
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?