
Security News
RubyGems Adds Cooldown Feature to Bundler for Newly Published Gems
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.
@supertokens-plugins/user-banning-react
Advanced tools
Add user banning functionality to your SuperTokens React application. This plugin provides a user-friendly interface for administrators to ban/unban users and integrates seamlessly with the backend user banning plugin.
npm install @supertokens-plugins/user-banning-react
Initialize the plugin in your SuperTokens frontend configuration:
import SuperTokens from "supertokens-auth-react";
import UserBanningPlugin from "@supertokens-plugins/user-banning-react";
SuperTokens.init({
appInfo: {
// your app info
},
recipeList: [
// your recipes
],
plugins: [
UserBanningPlugin.init({
userBanningPermission: "ban-user", // Optional: defaults to "ban-user"
bannedUserRole: "banned", // Optional: defaults to "banned"
onPermissionFailureRedirectPath: "/", // Optional: defaults to "/"
}),
],
});
[!IMPORTANT]
You also have to install and configure the backend plugin. Make sure that the roles and permissions are the same.
The plugin provides a complete administrative interface accessible at /admin/ban-user. This page includes:
| Option | Type | Default | Description |
|---|---|---|---|
userBanningPermission | string | "ban-user" | Permission required to access banning features |
bannedUserRole | string | "banned" | Role assigned to banned users |
onPermissionFailureRedirectPath | string | "/" | Redirect path when permission check fails |
Access exposed plugin functionality in your custom components:
import { usePlugin } from "@supertokens-plugins/user-banning-react";
function MyAdminComponent() {
const { api, pluginConfig, t } = usePlugin();
const handleBanUser = async (email: string) => {
try {
await api.updateBanStatus("public", email, true);
console.log("User banned successfully");
} catch (error) {
console.error("Failed to ban user:", error);
}
};
return (
<div>
<h2>{t("PL_UB_BAN_PAGE_TITLE")}</h2>
{/* Your custom UI */}
</div>
);
}
The plugin provides these API methods through the usePlugin hook:
Check if a user is banned:
const { api } = usePlugin();
// Check ban status
const result = await api.getBanStatus("public", "user@example.com");
if (result.status === "OK") {
console.log("User is banned:", result.banned);
} else {
console.error("Error:", result.message);
}
Ban or unban a user:
const { api } = usePlugin();
// Ban a user
await api.updateBanStatus("public", "user@example.com", true);
// Unban a user
await api.updateBanStatus("public", "user@example.com", false);
The plugin provides these translations for customizing the interface. THey can be found in the translations.ts file.
FAQs
User Banning Plugin for SuperTokens
We found that @supertokens-plugins/user-banning-react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.