@absolutejs/auth 0.85.0 → 0.86.0
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 +7 -0
- package/changelog.json +21 -0
- package/dist/bun.js +22 -1
- package/dist/bun.js.map +3 -3
- package/dist/cli/migrate.js +6 -6
- package/dist/cli/migrate.js.map +3 -3
- package/dist/index.js +57 -22
- package/dist/index.js.map +7 -7
- package/dist/organizations/config.d.ts +2 -0
- package/dist/organizations/operations.d.ts +6 -4
- package/dist/organizations/routes.d.ts +1 -1
- package/dist/organizations/types.d.ts +8 -0
- package/dist/server.js +57 -22
- package/dist/server.js.map +7 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,13 @@ 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.0 — 2026-09-23
|
|
10
|
+
|
|
11
|
+
### Breaking
|
|
12
|
+
|
|
13
|
+
- **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`)
|
|
14
|
+
_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.
|
|
15
|
+
|
|
9
16
|
## 0.85.0 — 2026-09-23
|
|
10
17
|
|
|
11
18
|
### Breaking
|
package/changelog.json
CHANGED
|
@@ -2,6 +2,27 @@
|
|
|
2
2
|
"contract": 1,
|
|
3
3
|
"name": "@absolutejs/auth",
|
|
4
4
|
"releases": [
|
|
5
|
+
{
|
|
6
|
+
"changes": [
|
|
7
|
+
{
|
|
8
|
+
"kind": "breaking",
|
|
9
|
+
"migration": {
|
|
10
|
+
"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.",
|
|
11
|
+
"manual": true
|
|
12
|
+
},
|
|
13
|
+
"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.",
|
|
14
|
+
"symbols": [
|
|
15
|
+
"acceptInvitation",
|
|
16
|
+
"OrganizationsConfig",
|
|
17
|
+
"OrganizationStore",
|
|
18
|
+
"listUserOrganizations",
|
|
19
|
+
"organizationRoutes"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"date": "2026-09-23",
|
|
24
|
+
"version": "0.86.0"
|
|
25
|
+
},
|
|
5
26
|
{
|
|
6
27
|
"changes": [
|
|
7
28
|
{
|
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=
|
|
18124
|
+
//# debugId=0AF087F2064BFFA264756E2164756E21
|
|
18104
18125
|
//# sourceMappingURL=bun.js.map
|