@guren/core 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -141,7 +141,7 @@ declare class DatabaseSessionStore implements SessionStore {
141
141
  *
142
142
  * Pass the Drizzle table for your `oauth_states` schema. Column property
143
143
  * names must match `stateHash` (text primary key), `provider`,
144
- * `redirectTo`, and `expiresAt`:
144
+ * `redirectTo`, `expiresAt`, and `binding`:
145
145
  *
146
146
  * ```ts
147
147
  * export const oauthStates = sqliteTable('oauth_states', {
@@ -149,9 +149,14 @@ declare class DatabaseSessionStore implements SessionStore {
149
149
  * provider: text('provider').notNull(),
150
150
  * redirectTo: text('redirect_to'),
151
151
  * expiresAt: integer('expires_at', { mode: 'timestamp_ms' }).notNull(),
152
+ * binding: text('binding'),
152
153
  * })
153
154
  * ```
154
155
  *
156
+ * `binding` is required for `authorize({ bindTo })` to survive the round trip
157
+ * to the provider. Without the column the store cannot persist it, and every
158
+ * bound state comes back unbound.
159
+ *
155
160
  * @example
156
161
  * ```ts
157
162
  * import { createOAuthManager, DatabaseOAuthStateStore } from '@guren/core'
package/dist/index.js CHANGED
@@ -194,7 +194,9 @@ var DatabaseOAuthStateStore = class {
194
194
  stateHash,
195
195
  provider: payload.provider,
196
196
  redirectTo: payload.redirectTo ?? null,
197
- expiresAt: payload.expiresAt
197
+ expiresAt: payload.expiresAt,
198
+ // Persisted, not derived: an unbound state verifies for any browser.
199
+ binding: payload.binding ?? null
198
200
  });
199
201
  }
200
202
  async find(stateHash) {
@@ -267,7 +269,8 @@ function mapRecordToPayload(record) {
267
269
  provider: String(record.provider),
268
270
  redirectTo: record.redirectTo == null ? void 0 : String(record.redirectTo),
269
271
  // fetchLive's isExpired check guarantees this parses.
270
- expiresAt: toDate(record.expiresAt)
272
+ expiresAt: toDate(record.expiresAt),
273
+ binding: record.binding == null ? void 0 : String(record.binding)
271
274
  };
272
275
  }
273
276
  function deleteRemovedRow(result) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guren/core",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -60,9 +60,9 @@
60
60
  "typecheck": "tsc --noEmit"
61
61
  },
62
62
  "dependencies": {
63
- "@guren/cli": "^2.0.0",
64
- "@guren/orm": "^2.0.0",
65
- "@guren/server": "^2.0.0"
63
+ "@guren/cli": "^2.2.0",
64
+ "@guren/orm": "^2.2.0",
65
+ "@guren/server": "^2.2.0"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@types/node": "^20.14.10",