@meistrari/auth-core 3.4.0 → 4.0.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/dist/index.mjs CHANGED
@@ -21,7 +21,7 @@ function isTokenExpired(token, expiresInMs) {
21
21
  return nowInSeconds > expirationTime;
22
22
  }
23
23
 
24
- const version = "3.4.0";
24
+ const version = "4.0.0";
25
25
 
26
26
  function parsedEnumValues(schema) {
27
27
  return Object.fromEntries(
@@ -405,15 +405,16 @@ function invitationSignupPluginClient() {
405
405
  id: "invitation-signup",
406
406
  getActions: ($fetch) => ({
407
407
  invitationSignup: {
408
- status: async (invitationId) => {
408
+ status: async (token) => {
409
409
  return await $fetch("/invitation/signup-status", {
410
- query: { invitationId }
410
+ method: "GET",
411
+ query: { token }
411
412
  });
412
413
  },
413
- setupPassword: async (invitationId, password) => {
414
+ setupPassword: async (token, password) => {
414
415
  return await $fetch("/invitation/setup-password", {
415
416
  method: "POST",
416
- body: { invitationId, password }
417
+ body: { token, password }
417
418
  });
418
419
  }
419
420
  }
@@ -2036,15 +2037,15 @@ class OrganizationService {
2036
2037
  /**
2037
2038
  * Gets the pre-login signup status for an invitation.
2038
2039
  *
2039
- * Public endpoint keyed by the invitation id from the emailed invite link.
2040
+ * Requires the opaque token delivered only in the invitation email.
2040
2041
  * While the invitation is pending, the result includes the invited email
2041
2042
  * and whether the invited user still needs to set up their account.
2042
2043
  *
2043
- * @param id - The invitation ID from the invite link
2044
+ * @param token - The opaque token from the invite link
2044
2045
  * @returns The invitation status with account-setup information
2045
2046
  */
2046
- async getInvitationSignupStatus(id) {
2047
- return await this.client.invitationSignup.status(id);
2047
+ async getInvitationSignupStatus(token) {
2048
+ return await this.client.invitationSignup.status(token);
2048
2049
  }
2049
2050
  /**
2050
2051
  * Creates a password for an invited user who has no account yet.
@@ -2053,12 +2054,12 @@ class OrganizationService {
2053
2054
  * the invited user has never signed in. The user is signed in as part of
2054
2055
  * the call; the session cookie is set on the response.
2055
2056
  *
2056
- * @param id - The invitation ID from the invite link
2057
+ * @param token - The single-use opaque token from the invite link
2057
2058
  * @param password - The password to create (minimum 8 characters)
2058
2059
  * @returns The session token and signed-in user
2059
2060
  */
2060
- async setupInvitationPassword(id, password) {
2061
- return await this.client.invitationSignup.setupPassword(id, password);
2061
+ async setupInvitationPassword(token, password) {
2062
+ return await this.client.invitationSignup.setupPassword(token, password);
2062
2063
  }
2063
2064
  /**
2064
2065
  * Removes a user from the active organization.
@@ -2578,12 +2579,14 @@ class UserService {
2578
2579
  });
2579
2580
  }
2580
2581
  /**
2581
- * Unlinks a provider from the current user. Requires an AAL2 session (gated
2582
+ * Unlinks an account from the current user. Requires an AAL2 session (gated
2582
2583
  * server-side). The server refuses to remove the user's last account.
2584
+ *
2585
+ * @param params.accountId - The account's `id` from {@link listAccounts}, not
2586
+ * the provider's account identifier
2583
2587
  */
2584
2588
  async unlinkAccount(params) {
2585
2589
  return await this.client.unlinkAccount({
2586
- providerId: params.providerId,
2587
2590
  accountId: params.accountId
2588
2591
  });
2589
2592
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/auth-core",
3
- "version": "3.4.0",
3
+ "version": "4.0.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -18,11 +18,11 @@
18
18
  "docs": "typedoc"
19
19
  },
20
20
  "dependencies": {
21
- "@better-auth/api-key": "1.6.26",
22
- "@better-auth/sso": "1.6.26",
23
- "better-auth": "1.6.26",
24
- "jose": "6.1.3",
25
- "zod": "4.3.6"
21
+ "@better-auth/api-key": "1.7.14",
22
+ "@better-auth/sso": "1.7.14",
23
+ "better-auth": "1.7.14",
24
+ "jose": "6.2.14",
25
+ "zod": "4.6.7"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/node": "latest",