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()
.
function blockByEmail(email: string): Promise<void>;
Login email address of the member to block.
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);
});
});
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.