Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

nocobase-app-plugin-verification

БесплатноБез исполняемых скриптовНе проверен

Configure and integrate NocoBase one-time verification codes, verified phone binding, and step-up credentials using server services and React hooks.

nocobaseот nocobase★ 25 082 звезды на GitHub

Об этом скилле

Integrate verification in a NocoBase application

Register the default export from @nocobase/app-plugin-verification/server after Authentication, Notification, and Notification Providers, including their setup dependencies. Install or apply database migrations before serving traffic. The plugin owns userPhones; account identity, sessions, and passwords belong to Authentication and Users. The plugin contributes no pages, no sign-in by SMS and no password reset routes: the application builds those flows on verify(). Installing it does not make a given application capable of any of them, so inspect the registered plugins and the verification configuration first. Verification codes must never travel through ordinary notification.send(), which persists messages; this plugin delivers only the code through sendTransient(). A step-up credential is never sent by SMS: the client exchanges the code for it and receives it in the response body of POST /api/verification/stepUpTokens, then presents it in the X-Verification-Token header of the protected request.

Import the API and hooks from @nocobase/app-plugin-verification/client. Use them inside the host application's Authentication and query providers. The client integration guide shows binding, changing a number, and confirming a sensitive operation. The hooks improve the user experience only: the business server must check permissions and consume its own step-up credential with consumeStepUp, whatever the caller. Notification channel and SMS provider settings stay in the nocobase-app-plugin-notification-providers Skill; ordinary notifications stay in nocobase-app-plugin-notification.

Configure SMS

Set up an SMS notification channel using the Notification Providers Skill; system-sms is the conventional name that its environment mapping fills, not a fixed requirement. The channel each flow uses is the one named by verification.bindPhone.channel for phone binding and verification.stepUp.channel for step-up, and each registered scene names its own channel. Use type: sms, service: aliyun or service: tencent, and a template such as code with a variable mapped from the message's code. Keep provider credentials in private environment mappings. Configure a stable application secrets keyring shared by all instances. Keep the preceding key during rotation until all codes issued under it expire.

Add the verification section to the application's defaultAppConfigs:

import { defineVerificationConfig } from '@nocobase/app-plugin-verification/server';

const verification = defineVerificationConfig({
  defaults: {
    ttlSeconds: 300,
    resendSeconds: 60,
    hourlyLimit: 5,
    maxAttempts: 5,
  },
  ipHourlyLimit: 20,
  userHourlyLimit: 20,
  stepUpTtlSeconds: 300,
  bindPhone: { channel: 'system-sms', template: 'code' },
  stepUp: { channel: 'system-sms', template: 'code' },
});

Each reserved scene is enabled when its destination is configured. Code expiry and attempt limits are overridable by scene. A scene may increase the common resend interval or decrease the common hourly number limit. The number limits apply across all SMS scenes and server instances. Anonymous requests use an IP quota, while signed-in requests use a separate quota per person. All sender counters use the configured application cache. Use a shared counter backend such as Redis in multi-instance deployments. Anonymous HTTP requests use the authentication plugin's peer-anchored auth.advanced.ipAddress proxy rules. Configure trustedProxies and, if needed, ipAddressHeaders to recognize your ingress. Forwarded addresses from untrusted peers are ignored. Requests with no peer metadata share a fallback bucket.

Register scenes and verify a code

Resolve verificationServiceToken during your server provider's boot and register scenes before use. Choose signedIn for a person proving control of a supplied target and verifiedPhone for a person receiving a code at their existing verified number. Use public for an intentional anonymous flow; provide an eligibility check when sends should be limited to known recipients. Public requests to ineligible targets still count toward limits and return the same response fields as submissions. Providers are contacted synchronously, so response timing may vary.

import { verificationServiceToken } from '@nocobase/app-plugin-verification/server';

const verification = container.resolve(verificationServiceToken);
verification.registerScene('confirmEnrollment', {
  method: 'sms',
  channel: 'system-sms',
  template: 'code',
  audience: 'signedIn',
});

await verification.verify({
  scene: 'confirmEnrollment',
  target: normalizedPhone,
  userId: authenticatedUser.id,
  code: submittedCode,
});

Clients request codes with POST /api/verification/codes/send, body { scene, phone? }. Supply a canonical E.164 phone for SMS unless the scene targets the user's verified phone.

Полный SKILL.md на GitHub

Установить nocobase-app-plugin-verification в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/client.md

FAQ

Что делает скилл nocobase-app-plugin-verification?

Configure and integrate NocoBase one-time verification codes, verified phone binding, and step-up credentials using server services and React hooks.

Как установить скилл nocobase-app-plugin-verification?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл nocobase-app-plugin-verification запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить nocobase-app-plugin-verification с