Search.../

blockByEmail( )

Blocks a member from logging in to the site.

Description

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

Note: This function replaces the deprecated wix-users-backend.blockByEmail(). The deprecated function will continue to work, but it will not receive updates. To keep any existing code compatible with future changes, see the migration instructions.

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

Syntax

function blockByEmail(email: string): Promise<void>

blockByEmail Parameters

NAME
TYPE
DESCRIPTION
email
string

Login email address of the member to block.

Returns

Fulfilled - When the member with the specified email is blocked. Rejected - Error message.

Return Type:

Promise<void>

Related Content:

Was this helpful?

Block a member

Copy Code
1import { authentication } from 'wix-members-backend';
2
3export function myBlockByEmailFunction(email) {
4 return authentication.blockByEmail(email)
5 .then(() => {
6 console.log('Email blocked from site membership');
7 })
8 .catch((error) => {
9 console.error(error);
10 });
11}