nocobase-app-plugin-authentication
БесплатноБез исполняемых скриптовНе проверенBuild authentication requirements in a NocoBase 3 application: protect API routes and pages with the session, read and refresh the session in the browser…
от nocobase★ 25 082 звезды на GitHubОб этом скилле
Authentication development
Use this Skill when an application built on @nocobase/app-plugin-authentication
needs anything about who the caller is: protecting a route or page, reading the
current user, changing the sign-in pages, adding a sign-in method, disabling
accounts, or preparing authentication for deployment.
Do not use it for what a signed-in user may do — that is
nocobase-app-plugin-authorization — or for the user administration page,
which is nocobase-app-plugin-users. Do not modify the plugin's own source,
migrations, or dist/; everything below is done in the application.
The plugin wraps Better Auth. Application configuration is Better Auth configuration, and every Better Auth plugin, social provider, and hook is available through it. Read the installed Better Auth version's documentation for option details; this Skill covers where those options go in a NocoBase application and what the plugin adds on top.
Enable an official Better Auth plugin before writing anything of your own: device login for a CLI (deviceAuthorization() with bearer()), organizations, two-factor and passkeys all exist upstream, and each needs only configuration, an application migration for its tables, and its UI. Enabling an official Better Auth plugin covers the rule, the schema check and the migration.
Public surfaces
Server, from @nocobase/app-plugin-authentication (the root entry is the
server entry) or @nocobase/app-plugin-authentication/server:
authenticationTokenresolves theAuthinstance:required(),optional(),getSession(headers),handler(request),signInUser(userId, request).AuthEnvtypes a Hono router whose routes readcontext.get('auth').userAdministrationServiceTokenresolvesUserAdministrationService:list,get,create,update,disable,enable,resetPassword,revokeSessions,withConnection; errors areUserAdministrationError.AuthConfigis Better Auth'sBetterAuthOptions, the type of the application'sserver/config/auth.ts. User initialization configuration lives separately underusers.initialAdmin.createAuthentication,databaseAdapter,createAuthStoragebuild an instance outside the application runtime, mainly in tests.
Client, from @nocobase/app-plugin-authentication/client:
authentication()is the registration factory. It mounts one React provider and registers two settings pages, so the application declares neither:- System settings › Accounts › Authentication (
/settings/authentication, route idAUTHENTICATION_SETTINGS_ROUTE_ID), read-only, behind theauthentication.settingssettings item'sreadaction, with its single sign-on guide at/settings/authentication/sso(AUTHENTICATION_SSO_GUIDE_ROUTE_ID) and the two-factor and passkey guides at/settings/authentication/two-factor(AUTHENTICATION_TWO_FACTOR_GUIDE_ROUTE_ID) and/settings/authentication/passkey(AUTHENTICATION_PASSKEY_GUIDE_ROUTE_ID). - Personal settings › Account › Account and security (
/me/security,ACCOUNT_SECURITY_ROUTE_ID), open to every signed-in person: sign-in details, change password, signed-in devices (command-line sign-ins included) and linked single sign-on or social accounts, all through Better Auth's own endpoints. authentication({ signInButtons: ['github'] })names the providers the application's sign-in page shows a button for; the settings page lists only those as sign-in page entries and marks other configured providers as having no button.- Replace a whole page with
authentication({ settingsComponentLoader, accountSecurityComponentLoader }), or withrouteComponentOverridesnaming the route ids above. See client session and pages.
- System settings › Accounts › Authentication (
useAuthentication()returns{ client, session, isPending, refresh };useAuthenticationClient()returns the Better Auth client alone.RequiredAuthentication,GuestAuthentication, andAuthenticationGuard({ mode })gate a route subtree on the session.AuthConfigis Better Auth's client options, the type of the application'sclient/config/auth.ts.authenticationClientTokenis the client's service token, used to stub the client in component tests.
Headless actions, from @nocobase/app-plugin-authentication/client/actions:
usePasswordLogin, usePasswordRegistration, usePasswordResetRequest,
usePasswordReset, each returning { submit, isPending, error }.
HTTP: every Better Auth endpoint is served under /api/auth/* by the plugin's own route. A Better Auth plugin's endpoints appear there automatically. Besides it the plugin serves three read-only routes: the public GET /api/authentication/capabilities (whether password reset is available); GET /api/authentication/settings, the effective sign-in settings, where each comes from (env with the variable's name, file for config.yml, code, or default) and the
Установить nocobase-app-plugin-authentication в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл nocobase-app-plugin-authentication?
Build authentication requirements in a NocoBase 3 application: protect API routes and pages with the session, read and refresh the session in the browser, customize the login, registration and password pages, add sign-in methods such as social login, OIDC or a custom Better Auth plugin, enable official Better Auth plugins (device login for a CLI, bearer tokens, organizations, two-factor, passkeys) with the migration their tables need, manage account lifecycle from server code, and configure secrets, cookies and shared storage for deployment.
Как установить скилл nocobase-app-plugin-authentication?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл nocobase-app-plugin-authentication запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic