You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(auth)!: 6-digit OTP pairing code and crypto-secure tokens
Separate the two roles the auth flow previously conflated. The persistent
client bearer token and remote-dock tokens become high-entropy, CSPRNG
credentials, while the human-typed pairing code becomes an easy-to-enter
6-digit one-time code guarded by a short TTL and an attempt cap.
The pairing code is single-use, expires after five minutes, is compared in
constant time, and rotates after five failed attempts, so its shorter length
stays brute-force resistant. Bearer and dock tokens move off the vendored
word-list generator (which relied on Math.random) to WebCrypto-backed
randomness.
The vendored human-id helper is removed in favour of a new
`devframe/utils/crypto-token` util exposing `randomToken`, `randomDigits`,
and `timingSafeEqual`.
BREAKING CHANGE: the `devframe/utils/human-id` export is removed. Use
`randomToken` from `devframe/utils/crypto-token` for random identifiers.
const value =structuredCloneParse<Map<string, number>>(wire)
75
75
```
76
76
77
-
### `devframe/utils/human-id`
77
+
### `devframe/utils/nanoid`
78
78
79
-
Generate a human-readable, lowercase, dash-separated random ID.
79
+
Tiny URL-safe random ID generator (vendored, no runtime dependency).
80
80
81
81
```ts
82
-
import { humanId } from'devframe/utils/human-id'
82
+
import { nanoid } from'devframe/utils/nanoid'
83
83
84
-
humanId() // 'bright-orange-tiger'
84
+
nanoid() // 21 chars
85
+
nanoid(10) // 10 chars
85
86
```
86
87
87
-
### `devframe/utils/nanoid`
88
+
### `devframe/utils/crypto-token`
88
89
89
-
Tiny URL-safe random ID generator (vendored, no runtime dependency).
90
+
Cryptographically-secure token helpers built on the WebCrypto global, so they run in browsers and Node alike. Use these for bearer credentials and human-typed one-time codes.
0 commit comments