@absolutejs/auth 0.85.0 → 0.86.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/CHANGELOG.md CHANGED
@@ -6,6 +6,19 @@ This file is generated by `absolute-changelog` from the entries in
6
6
  `changelog/`. Edit an entry, not this file — and add new ones under
7
7
  `changelog/unreleased/`.
8
8
 
9
+ ## 0.86.1 — 2026-09-23
10
+
11
+ ### Fixed
12
+
13
+ - **Allow authorized nonmember organization managers to list memberships. Revoke invitations when their delivery hook fails and return a sanitized retryable error.** (`organizationRoutes`, `createAuthApplications`)
14
+
15
+ ## 0.86.0 — 2026-09-23
16
+
17
+ ### Breaking
18
+
19
+ - **Bind organization invitation acceptance to a verified email and atomically consume the invitation with membership creation. Deny expired, revoked, missing-organization and suspended-member invitations; preserve existing member roles.** (`acceptInvitation`, `OrganizationsConfig`, `OrganizationStore`, `listUserOrganizations`, `organizationRoutes`)
20
+ _Migration:_ Configure organizations.getVerifiedEmail with provider-verified email evidence. Direct acceptInvitation callers must supply verifiedEmail. Custom OrganizationStore adapters must implement atomic acceptInvitation; older adapters fail closed.
21
+
9
22
  ## 0.85.0 — 2026-09-23
10
23
 
11
24
  ### Breaking
package/changelog.json CHANGED
@@ -2,6 +2,41 @@
2
2
  "contract": 1,
3
3
  "name": "@absolutejs/auth",
4
4
  "releases": [
5
+ {
6
+ "changes": [
7
+ {
8
+ "kind": "fixed",
9
+ "summary": "Allow authorized nonmember organization managers to list memberships. Revoke invitations when their delivery hook fails and return a sanitized retryable error.",
10
+ "symbols": [
11
+ "organizationRoutes",
12
+ "createAuthApplications"
13
+ ]
14
+ }
15
+ ],
16
+ "date": "2026-09-23",
17
+ "version": "0.86.1"
18
+ },
19
+ {
20
+ "changes": [
21
+ {
22
+ "kind": "breaking",
23
+ "migration": {
24
+ "instruction": "Configure organizations.getVerifiedEmail with provider-verified email evidence. Direct acceptInvitation callers must supply verifiedEmail. Custom OrganizationStore adapters must implement atomic acceptInvitation; older adapters fail closed.",
25
+ "manual": true
26
+ },
27
+ "summary": "Bind organization invitation acceptance to a verified email and atomically consume the invitation with membership creation. Deny expired, revoked, missing-organization and suspended-member invitations; preserve existing member roles.",
28
+ "symbols": [
29
+ "acceptInvitation",
30
+ "OrganizationsConfig",
31
+ "OrganizationStore",
32
+ "listUserOrganizations",
33
+ "organizationRoutes"
34
+ ]
35
+ }
36
+ ],
37
+ "date": "2026-09-23",
38
+ "version": "0.86.0"
39
+ },
5
40
  {
6
41
  "changes": [
7
42
  {
package/dist/bun.js CHANGED
@@ -16918,6 +16918,27 @@ var toInvitation = (row) => ({
16918
16918
  });
16919
16919
  var createNeonOrganizationStore = (databaseUrl) => createPostgresOrganizationStore(createNeonDatabase(databaseUrl));
16920
16920
  var createPostgresOrganizationStore = (db) => ({
16921
+ acceptInvitation: async ({ now, tokenHash, userId, verifiedEmail }) => {
16922
+ const claimed = db.$with("claimed").as(db.update(organizationInvitationsTable).set({ accepted_at_ms: now, state: "accepted" }).where(and(eq(organizationInvitationsTable.token_hash, tokenHash), eq(organizationInvitationsTable.state, "pending"), gt3(organizationInvitationsTable.expires_at_ms, now), sql`lower(trim(${organizationInvitationsTable.email})) = ${verifiedEmail}`, exists(db.select().from(organizationsTable).where(eq(organizationsTable.organization_id, organizationInvitationsTable.organization_id))), notExists(db.select().from(organizationMembershipsTable).where(and(eq(organizationMembershipsTable.organization_id, organizationInvitationsTable.organization_id), eq(organizationMembershipsTable.user_id, userId), eq(organizationMembershipsTable.status, "suspended")))))).returning({
16923
+ organizationId: organizationInvitationsTable.organization_id,
16924
+ roles: organizationInvitationsTable.roles
16925
+ }));
16926
+ const [row] = await db.with(claimed).insert(organizationMembershipsTable).select(db.select({
16927
+ created_at_ms: sql`${now}`.as("created_at_ms"),
16928
+ organization_id: claimed.organizationId,
16929
+ roles: claimed.roles,
16930
+ status: sql`'active'`.as("status"),
16931
+ updated_at_ms: sql`${now}`.as("updated_at_ms"),
16932
+ user_id: sql`${userId}`.as("user_id")
16933
+ }).from(claimed)).onConflictDoUpdate({
16934
+ set: { user_id: userId },
16935
+ target: [
16936
+ organizationMembershipsTable.organization_id,
16937
+ organizationMembershipsTable.user_id
16938
+ ]
16939
+ }).returning();
16940
+ return row && row.status === "active" ? toMembership(row) : undefined;
16941
+ },
16921
16942
  deleteOrganization: async (organizationId) => {
16922
16943
  await db.delete(organizationsTable).where(eq(organizationsTable.organization_id, organizationId));
16923
16944
  },
@@ -18100,5 +18121,5 @@ export {
18100
18121
  runBunMigrations
18101
18122
  };
18102
18123
 
18103
- //# debugId=9FFA32330DB0997464756E2164756E21
18124
+ //# debugId=0AF087F2064BFFA264756E2164756E21
18104
18125
  //# sourceMappingURL=bun.js.map