@absolutejs/auth 0.86.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 +6 -0
- package/changelog.json +14 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +17 -9
- package/dist/index.js.map +3 -3
- package/dist/organizations/routes.d.ts +1 -0
- package/dist/server.js +17 -9
- package/dist/server.js.map +3 -3
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -11427,13 +11427,21 @@ var organizationRoutes = ({
|
|
|
11427
11427
|
organizationStore,
|
|
11428
11428
|
roles: roles ?? []
|
|
11429
11429
|
});
|
|
11430
|
-
|
|
11431
|
-
|
|
11432
|
-
|
|
11433
|
-
|
|
11434
|
-
|
|
11435
|
-
|
|
11436
|
-
|
|
11430
|
+
try {
|
|
11431
|
+
await onSendInvitation?.({
|
|
11432
|
+
email: invitation.email,
|
|
11433
|
+
expiresAt: invitation.expiresAt,
|
|
11434
|
+
inviterUserId: invitation.inviterUserId,
|
|
11435
|
+
organizationId,
|
|
11436
|
+
token
|
|
11437
|
+
});
|
|
11438
|
+
} catch {
|
|
11439
|
+
await organizationStore.saveInvitation({
|
|
11440
|
+
...invitation,
|
|
11441
|
+
state: "revoked"
|
|
11442
|
+
});
|
|
11443
|
+
return status("Bad Gateway", "Invitation delivery failed; create a new invitation to retry");
|
|
11444
|
+
}
|
|
11437
11445
|
await emit?.({
|
|
11438
11446
|
at: Date.now(),
|
|
11439
11447
|
metadata: { email: invitation.email },
|
|
@@ -11541,7 +11549,7 @@ var organizationRoutes = ({
|
|
|
11541
11549
|
return status("Unauthorized", "Authentication required");
|
|
11542
11550
|
}
|
|
11543
11551
|
const membership = await organizationStore.getMembership(organizationId, getUserId(user));
|
|
11544
|
-
if (membership?.status !== "active") {
|
|
11552
|
+
if (membership?.status !== "active" && !await mayManage(user, organizationId)) {
|
|
11545
11553
|
return status("Forbidden", "Not a member");
|
|
11546
11554
|
}
|
|
11547
11555
|
const members = await organizationStore.listMembershipsByOrganization(organizationId);
|
|
@@ -42247,5 +42255,5 @@ export {
|
|
|
42247
42255
|
userSessionIdTypebox
|
|
42248
42256
|
};
|
|
42249
42257
|
|
|
42250
|
-
//# debugId=
|
|
42258
|
+
//# debugId=E5C70909EAE2DA0864756E2164756E21
|
|
42251
42259
|
//# sourceMappingURL=server.js.map
|