Vite后台

preact-auth-passkey-center — Vite 后台模板

作者 smart-developer1791

基于 Preact 的通行密钥与受信设备管理面板模板,包含 WebAuthn 能力检测、模拟注册与验证流程、凭据清单、安全评分和活动时间线。

看看你的网站会是什么样

浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。

2 个预览视图
桌面端首页1 / 2
桌面端截图首屏预览

由服务器浏览器实际访问页面后截取。

全部页面与视图 2

截图用于了解视觉与布局,交互效果请以实际项目为准。

采集于 2026-10-17查看来源

值得关注的模板亮点

从已有项目资料中,快速了解它的特点。

01

凭据清单展示同步型与设备绑定型通行密钥的使用、位置、创建时间与复核状态

02

使用 @simplewebauthn/browser 检测浏览器和平台认证器支持情况

03

注册对话框模拟平台认证器与硬件密钥注册,测试登录模拟断言验证并更新使用元数据

04

撤销通行密钥需确认,并记录到活动时间线

05

演示凭据通过 idb-keyval 持久化到 IndexedDB,清除浏览器存储后重置

06

提供安全评分与响应式清单布局,移动端将表格行转为堆叠记录

模板详细介绍

该模板是一个面向账户安全设置场景的前端演示面板,用于展示通行密钥(passkey)与受信设备的管理界面。README 说明其包含凭据清单,列出同步型与设备绑定型通行密钥的使用情况、位置、创建时间和复核状态;通过 @simplewebauthn/browser 检测浏览器与平台认证器支持情况;提供注册对话框,模拟平台认证器与硬件密钥的注册;提供测试登录,模拟断言验证并刷新凭据使用元数据;支持确认后撤销选中的通行密钥并记录事件。演示数据保存在 IndexedDB 中,包含三条覆盖同步平台、移动端和设备绑定硬件密钥的示例凭据,其中 YubiKey 初始处于待复核状态,测试成功后转为正常。界面还提供安全评分和活动时间线,并在移动端将桌面表格行转为堆叠记录。

需要明确的是,README 指出项目有意模拟认证流程的完成,因为注册与认证选项必须由后端生成和验证;所有身份、挑战、设备和响应均为合成数据,仅保留在浏览器中。模板不包含真实后端,认证模板属于参考实现,不能替代安全评审、威胁建模和服务端强制校验。WebAuthn 需要安全上下文,开发时 localhost 可用。凭据名称与设备标签属于账户元数据,不能作为认证器身份的证明。密集的清单布局仍以桌面账户设置场景为主。README 未提供关于生产就绪程度、性能或真实服务端集成的进一步说明。

Vite后台

适合你的项目吗?

适用场景

  • 演示账户安全设置中的通行密钥清单与状态管理界面
  • 在接入真实后端前,用模拟服务测试加载、禁用、成功与失败等交互状态
  • 向团队展示 WebAuthn 能力检测与兼容性状态的不同呈现方式
  • 作为替换 src/services/ 中模拟 API 为真实 HTTP 客户端的前端起点

适合人群

  • 需要通行密钥管理界面参考的前端开发者
  • 希望了解 WebAuthn 前端交互与状态展示的团队
  • 使用 Preact、TypeScript 与 Tailwind CSS 构建账户安全页面的项目

上手与定制指南

结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。

  1. 1

    本地运行需执行 npm install 与 npm run dev,并访问 http://localhost:5173

  2. 2

    WebAuthn 需要安全上下文,开发阶段可使用 localhost

  3. 3

    注册与认证选项须由后端生成和验证,模板仅模拟流程完成

  4. 4

    接入真实服务时替换 src/services/ 中的函数,并保留 UI 使用的领域契约

  5. 5

    构建与检查命令包括 npm run format:check、npm run build、npm run preview 和 npm audit --omit=dev

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。

使用时需要遵守

  • 允许免费使用、修改、商用和分发该版本代码。
  • 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
  • 代码按现状提供;担保与责任限制以原许可证及适用法律为准。

额外费用与待核对事项

  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
  • 项目有意模拟认证流程完成,因为注册与认证选项必须由后端生成和验证;模板不含真实后端。
  • startRegistration 与 startAuthentication 只能配合服务端签发的挑战使用,并须在服务端校验 origin、RP ID、计数器与用户绑定。
  • WebAuthn 需要安全上下文,仅 localhost 在开发阶段被接受。
  • 凭据名称与设备标签属于账户元数据,不能作为认证器身份的证明。
  • 界面虽响应式,但密集的清单布局仍以桌面账户设置场景为主。
  • 接入真实服务需替换 src/services/ 中的函数,并保留 UI 使用的领域契约。
  • 认证模板属于参考实现,不能替代安全评审、威胁建模与服务端强制校验。
  • 所有身份、挑战、设备与响应均为合成数据,仅保留在浏览器中。
  • 新增凭据与删除操作仅在本地持久化,清除浏览器存储后即重置。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

- The project intentionally simulates ceremony completion because registration and authentication options must be generated and verified by a backend.

README 原文

- Use `startRegistration` and `startAuthentication` only with server-issued challenges and verify origin, RP ID, counter, and user binding on the server.

README 原文

- WebAuthn requires a secure context; localhost is accepted for development.

README 原文

- Credential names and device labels are account metadata, not proof of authenticator identity.

README 原文

- The interface is responsive, while its denser inventory layout remains optimized for account-settings use on desktop.

README 原文

- Replace functions in `src/services/` with your HTTP client while preserving the domain contracts used by the UI.

README 原文

- Authentication templates are reference implementations, not a substitute for a security review, threat model, and server enforcement.

README 原文

All identities, challenges, devices, and responses are synthetic and remain in the browser.

README 原文

- New credentials and removals persist locally until browser storage is cleared.

README 原文
https://github.com/smart-developer1791/preact-auth-passkey-center/blob/master/LICENSEhttps://github.com/smart-developer1791/preact-auth-passkey-center/blob/master/README.md

DeepSeek 根据仓库许可证和 README 整理 ·2026-10-17。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。

项目核对记录与介绍依据

模板资料

来源平台
GitHub
资料与维护参考分
资料较完整 · 80 / 100
技术栈
Vite
网站类型
后台
这个分数如何计算

本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。

这个项目需要核对什么

记录的仓库更新时间
2026-07-20
截图检查日期
2026-10-17

已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。

目录记录的主要技术栈是 Vite。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。

查看具体选型方法 →

介绍的制作与核对状态

介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。

审核声明: codex-user-requested-batch-review-20261018 · 2026-10-18

查看当时使用的来源资料

SHA-256: 6d16b4f1d252885f4707c8836d2d2f649ab12d8c5cc0fe4b5a5b69c4ac272153

2026-10-17T22:12:03.936Z

来源文件 / 仓库
<div align="center">

# ✦ Preact Auth Passkey Center

**A practical passkey and trusted-device dashboard with WebAuthn capability checks, mock ceremonies, inventory, and security activity.**

![Preact](https://img.shields.io/badge/Preact-10-673ab8?style=for-the-badge&logo=preact&logoColor=ffffff)
![TypeScript](https://img.shields.io/badge/TypeScript-6-3178c6?style=for-the-badge&logo=typescript&logoColor=ffffff)
![Tailwind CSS](https://img.shields.io/badge/Tailwind_CSS-4-38B2AC?style=for-the-badge&logo=tailwind-css&logoColor=ffffff)
![WebAuthn](https://img.shields.io/badge/WebAuthn-Template-347D68?style=for-the-badge)
![Vite](https://img.shields.io/badge/Vite-8-646CFF?style=for-the-badge&logo=vite&logoColor=ffffff)

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new)

</div>

---

## ✨ Highlights

- **Credential Inventory:** Lists synced and device-bound passkeys with usage, location, creation, and review state.
- **WebAuthn Detection:** Uses `@simplewebauthn/browser` to detect browser and platform-authenticator support.
- **Registration Dialog:** Models platform and hardware-key registration with a reusable service boundary.
- **Test Sign-in:** Simulates assertion verification and refreshes credential usage metadata.
- **Credential Revocation:** Removes a selected passkey after confirmation and records the event.
- **Local Persistence:** Keeps the evolving demo credential inventory in IndexedDB.
- **Security Score:** Summarizes passkey health and calls out inactive hardware credentials.
- **Activity Timeline:** Tracks registration, test authentication, and revocation events.
- **Responsive Inventory:** Converts the desktop table-like rows into readable stacked mobile records.
- **Compatibility States:** Clearly distinguishes WebAuthn readiness, platform support, and fallback behavior.
- **Accessible Dialog:** Supports backdrop dismissal, modal semantics, labels, and explicit action controls.

## 🧱 Project Structure

```text
public/
`-- favicon.svg
src/
|-- app.tsx
|-- main.tsx
|-- index.css
|-- components/
|   |-- add-passkey-dialog.tsx
|   `-- passkey-row.tsx
|-- domain/
|   `-- passkeys.ts
`-- services/
    `-- mock-passkey-api.ts
```

## 🛠️ Tech Stack

- Preact 10 with Vite 8
- TypeScript 6
- Tailwind CSS 4
- Prettier 3
- `@simplewebauthn/browser`
- Zod
- `idb-keyval`
- `lucide-preact`

## 📦 Included Demo Data

- Three passkeys cover synced platform, mobile, and device-bound hardware credentials.
- The YubiKey begins in a review state and becomes healthy after a successful test.
- New credentials and removals persist locally until browser storage is cleared.

All identities, challenges, devices, and responses are synthetic and remain in the browser.

## 🚀 Local Development

```bash
npm install
npm run dev
```

Open `http://localhost:5173`.

## 🔌 Extension Notes & Nuances

- The project intentionally simulates ceremony completion because registration and authentication options must be generated and verified by a backend.
- Use `startRegistration` and `startAuthentication` only with server-issued challenges and verify origin, RP ID, counter, and user binding on the server.
- WebAuthn requires a secure context; localhost is accepted for development.
- Credential names and device labels are account metadata, not proof of authenticator identity.
- The interface is responsive, while its denser inventory layout remains optimized for account-settings use on desktop.
- Mock calls include visible latency so loading, disabled, success, and failure states can be tested before connecting a real API.
- Replace functions in `src/services/` with your HTTP client while preserving the domain contracts used by the UI.
- Authentication templates are reference implementations, not a substitute for a security review, threat model, and server enforcement.

## 🧪 Build & Checks

```bash
npm run format:check
npm run build
npm run preview
npm audit --omit=dev
```

## 🌐 Vercel Deployment

```json
{
  "$schema": "https://openapi.vercel.sh/vercel.json",
  "framework": "vite",
  "buildCommand": "npm run build",
  "outputDirectory": "dist",
  "rewrites": [{ "source": "/(.*)", "destination": "/index.html" }]
}
```

## 📄 License

MIT License. See [LICENSE](./LICENSE).
反馈内容错误

看看同类模板

对比同技术栈与用途的模板,找到更适合的视觉与内容结构。