Skip to main content

@supertokens-plugins/user-banning-nodejs

Classes

UserBanningService

Defined in: supertokens-plugins/packages/user-banning-nodejs/src/userBanningService.ts:17

Constructors

Constructor
new UserBanningService(pluginConfig: SuperTokensPluginUserBanningPluginNormalisedConfig): UserBanningService;

Defined in: supertokens-plugins/packages/user-banning-nodejs/src/userBanningService.ts:21

Parameters
Returns

UserBanningService

Properties

PropertyModifierTypeDefault valueDefined in
addBanToCachepublic(this: UserBanningService, tenantId: string, userId: string) => Promise<void>undefinedsupertokens-plugins/packages/user-banning-nodejs/src/userBanningService.ts:30
cacheprotectedMap<string, boolean>undefinedsupertokens-plugins/packages/user-banning-nodejs/src/userBanningService.ts:18
cachePreLoadPromiseprotectedPromise<void>undefinedsupertokens-plugins/packages/user-banning-nodejs/src/userBanningService.ts:19
checkAndAddBannedUserRoleIfNeededpublic(this: UserBanningService, userContext?: UserContext) => Promise< | { message: string; status: string; } | { message?: undefined; status: string; }>undefinedsupertokens-plugins/packages/user-banning-nodejs/src/userBanningService.ts:65
getBanStatuspublic(this: UserBanningService, tenantId: string, userId: string, userContext?: UserContext) => Promise< | { banned: boolean; status: "OK"; } | { message: string; status: "UNKNOWN_ERROR"; }>undefinedsupertokens-plugins/packages/user-banning-nodejs/src/userBanningService.ts:90
getBanStatusFromCachepublic(this: UserBanningService, tenantId: string, userId: string) => Promise<boolean>undefinedsupertokens-plugins/packages/user-banning-nodejs/src/userBanningService.ts:38
pluginConfigprotectedSuperTokensPluginUserBanningPluginNormalisedConfigundefinedsupertokens-plugins/packages/user-banning-nodejs/src/userBanningService.ts:21
preLoadCachepublic(this: UserBanningService, userContext?: UserContext) => Promise<void>undefinedsupertokens-plugins/packages/user-banning-nodejs/src/userBanningService.ts:42
preLoadCacheIfNeededpublic(this: UserBanningService, userContext?: UserContext) => Promise<void>undefinedsupertokens-plugins/packages/user-banning-nodejs/src/userBanningService.ts:23
removeBanFromCachepublic(this: UserBanningService, tenantId: string, userId: string) => Promise<void>undefinedsupertokens-plugins/packages/user-banning-nodejs/src/userBanningService.ts:34
setBanStatusAndUpdateSessionspublic(this: UserBanningService, tenantId: string, userId: string, isBanned: boolean, userContext?: UserContext) => Promise< | { status: "OK"; } | { status: "UNKNOWN_ROLE_ERROR"; } | { status: "USER_NOT_FOUND"; }>undefinedsupertokens-plugins/packages/user-banning-nodejs/src/userBanningService.ts:129
updateSessionspublic(this: UserBanningService, userId: string, tenantId: string, isBanned: boolean, userContext?: UserContext) => Promise<void>undefinedsupertokens-plugins/packages/user-banning-nodejs/src/userBanningService.ts:112

Type Aliases

SuperTokensPluginUserBanningPluginConfig

type SuperTokensPluginUserBanningPluginConfig = {
bannedUserRole?: string;
globalBanning?: boolean;
userBanningPermission?: string;
};

Defined in: supertokens-plugins/packages/user-banning-nodejs/src/types.ts:1

Properties

SuperTokensPluginUserBanningPluginNormalisedConfig

type SuperTokensPluginUserBanningPluginNormalisedConfig = {
bannedUserRole: string;
globalBanning: boolean;
userBanningPermission: string;
};

Defined in: supertokens-plugins/packages/user-banning-nodejs/src/types.ts:7

Properties

Variables

default

default: {
init: any;
};

Defined in: supertokens-plugins/packages/user-banning-nodejs/src/index.ts:4

Type Declaration

DEFAULT_BANNED_USER_ROLE

const DEFAULT_BANNED_USER_ROLE: "banned" = "banned";

Defined in: supertokens-plugins/packages/user-banning-nodejs/src/constants.ts:9

DEFAULT_GLOBAL_BANNING

const DEFAULT_GLOBAL_BANNING: true = true;

Defined in: supertokens-plugins/packages/user-banning-nodejs/src/constants.ts:10

DEFAULT_PERMISSION_NAME

const DEFAULT_PERMISSION_NAME: "ban-user" = "ban-user";

Defined in: supertokens-plugins/packages/user-banning-nodejs/src/constants.ts:8

enableDebugLogs

enableDebugLogs: any;

Defined in: supertokens-plugins/packages/user-banning-nodejs/src/logger.ts:4

HANDLE_BASE_PATH

const HANDLE_BASE_PATH: "/plugin/supertokens-plugin-user-banning";

Defined in: supertokens-plugins/packages/user-banning-nodejs/src/constants.ts:6

init

const init: any;

Defined in: supertokens-plugins/packages/user-banning-nodejs/src/plugin.ts:20

logDebugMessage

logDebugMessage: any;

Defined in: supertokens-plugins/packages/user-banning-nodejs/src/logger.ts:4

PLUGIN_ERROR_NAME

const PLUGIN_ERROR_NAME: "supertokens-plugin-user-banning-error";

Defined in: supertokens-plugins/packages/user-banning-nodejs/src/constants.ts:12

PLUGIN_ID

const PLUGIN_ID: "supertokens-plugin-user-banning" = "supertokens-plugin-user-banning";

Defined in: supertokens-plugins/packages/user-banning-nodejs/src/constants.ts:1

PLUGIN_SDK_VERSION

const PLUGIN_SDK_VERSION: string[];

Defined in: supertokens-plugins/packages/user-banning-nodejs/src/constants.ts:4

PLUGIN_VERSION

const PLUGIN_VERSION: "0.0.1" = "0.0.1";

Defined in: supertokens-plugins/packages/user-banning-nodejs/src/constants.ts:2