·aptx-api-plugin-auth
!

aptx-api-plugin-auth

使用 @aptx/api-plugin-auth 实现 token 认证中间件和控制器。支持自动添加 Authorization header、token 刷新(主动/被动401处理)、防止重复刷新、失败回调。触发条件:用户请求认证功能(配置中间件、处理401刷新、管理token)或代码涉及 createAuthMiddleware/createAuthController 时使用。

20Installs·0Trend·@haibaraaiaptx

Installation

$npx skills add https://github.com/haibaraaiaptx/aptx-skill --skill aptx-api-plugin-auth

How to Install aptx-api-plugin-auth

Quickly install aptx-api-plugin-auth AI skill to your development environment via command line

  1. Open Terminal: Open your terminal or command line tool (Terminal, iTerm, Windows Terminal, etc.)
  2. Run Installation Command: Copy and run this command: npx skills add https://github.com/haibaraaiaptx/aptx-skill --skill aptx-api-plugin-auth
  3. Verify Installation: Once installed, the skill will be automatically configured in your AI coding environment and ready to use in Claude Code, Cursor, or OpenClaw

Source: haibaraaiaptx/aptx-skill.

SKILL.md

View raw

| 选项 | 类型 | 必填 | 默认值 | 说明 |

| store | TokenStore | ✅ | - | Token 持久化抽象(必须实现 TokenStore 接口) | | refreshToken | Promise | ✅ | - | 刷新 token 的异步函数 | | refreshLeewayMs | number | ❌ | 60000 | 提前刷新的时间窗口(毫秒) | | shouldRefresh | (error, req, ctx) => boolean | ❌ | 401 检查 | 判断是否需要刷新的条件。error 结构:{ status?: number, message?: string, code?: string } |

| onRefreshFailed | (error) => void | ❌ | - | 刷新失败回调 | | headerName | string | ❌ | "Authorization" | 自定义 header 名称 | | tokenPrefix | string | ❌ | "Bearer " | Token 前缀 | | maxRetry | number | ❌ | 1 | 刷新失败后重试次数 |

Facts (cite-ready)

Stable fields and commands for AI/search citations.

Install command
npx skills add https://github.com/haibaraaiaptx/aptx-skill --skill aptx-api-plugin-auth
Category
!Security
Verified
First Seen
2026-02-25
Updated
2026-03-10

Browse more skills from haibaraaiaptx/aptx-skill

Quick answers

What is aptx-api-plugin-auth?

使用 @aptx/api-plugin-auth 实现 token 认证中间件和控制器。支持自动添加 Authorization header、token 刷新(主动/被动401处理)、防止重复刷新、失败回调。触发条件:用户请求认证功能(配置中间件、处理401刷新、管理token)或代码涉及 createAuthMiddleware/createAuthController 时使用。 Source: haibaraaiaptx/aptx-skill.

How do I install aptx-api-plugin-auth?

Open your terminal or command line tool (Terminal, iTerm, Windows Terminal, etc.) Copy and run this command: npx skills add https://github.com/haibaraaiaptx/aptx-skill --skill aptx-api-plugin-auth Once installed, the skill will be automatically configured in your AI coding environment and ready to use in Claude Code, Cursor, or OpenClaw

Where is the source repository?

https://github.com/haibaraaiaptx/aptx-skill