@meistrari/auth-core 1.7.2 → 1.7.4

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
@@ -6,7 +6,7 @@ import { createAccessControl } from 'better-auth/plugins/access';
6
6
  import { defaultStatements } from 'better-auth/plugins/organization/access';
7
7
  export { BetterFetchError as APIError } from '@better-fetch/fetch';
8
8
 
9
- const version = "1.7.2";
9
+ const version = "1.7.4";
10
10
 
11
11
  const statements = {
12
12
  ...defaultStatements,
@@ -189,7 +189,6 @@ function createAPIClient(apiUrl, fetchOptions = {}) {
189
189
  }
190
190
  });
191
191
  }
192
- createAPIClient("");
193
192
 
194
193
  class BaseError extends Error {
195
194
  code;
@@ -443,13 +442,12 @@ class OrganizationService {
443
442
  });
444
443
  }
445
444
  /**
446
- * Removes a user from the active organization.
447
- *
448
- * @param options - User identifier (either memberId or userEmail must be provided)
449
- * @param options.memberId - The member ID to remove
450
- * @param options.userEmail - The user email to remove
451
-
452
- */
445
+ * Removes a user from the active organization.
446
+ *
447
+ * @param options - User identifier (either memberId or userEmail must be provided)
448
+ * @param options.memberId - The member ID to remove
449
+ * @param options.userEmail - The user email to remove
450
+ */
453
451
  async removeUserFromOrganization({ memberId, userEmail }) {
454
452
  await this.client.organization.removeMember({
455
453
  memberIdOrEmail: memberId ?? userEmail
@@ -567,12 +565,7 @@ class EmailRequired extends BaseError {
567
565
  }
568
566
 
569
567
  function isValidUrl(url) {
570
- try {
571
- new URL(url);
572
- return true;
573
- } catch (error) {
574
- return false;
575
- }
568
+ return URL.canParse(url);
576
569
  }
577
570
  class SessionService {
578
571
  /**
@@ -813,7 +806,8 @@ class AuthClient {
813
806
 
814
807
  function isTokenExpired(token, expiresInMs) {
815
808
  const payload = JSON.parse(atob(token.split(".")[1] ?? ""));
816
- if (!payload.exp) return false;
809
+ if (!payload.exp)
810
+ return false;
817
811
  const nowInSeconds = Date.now() / 1e3;
818
812
  const expirationTime = payload.exp;
819
813
  if (expiresInMs !== void 0) {
@@ -834,7 +828,7 @@ async function validateToken(token, apiUrl) {
834
828
  issuer: apiUrl
835
829
  });
836
830
  return true;
837
- } catch (error) {
831
+ } catch {
838
832
  return false;
839
833
  }
840
834
  }
package/package.json CHANGED
@@ -1,32 +1,32 @@
1
1
  {
2
- "name": "@meistrari/auth-core",
3
- "version": "1.7.2",
4
- "type": "module",
5
- "exports": {
6
- ".": {
7
- "types": "./dist/index.d.ts",
8
- "import": "./dist/index.mjs"
9
- }
10
- },
11
- "main": "./dist/index.mjs",
12
- "types": "./dist/index.d.ts",
13
- "files": [
14
- "dist"
15
- ],
16
- "scripts": {
17
- "build": "unbuild"
18
- },
19
- "dependencies": {
20
- "@better-auth/sso": "1.4.7",
21
- "better-auth": "1.4.7",
22
- "jose": "6.1.0",
23
- "nanostores": "1.0.1",
24
- "@better-fetch/fetch": "1.1.21",
25
- "better-call": "1.1.5"
26
- },
27
- "devDependencies": {
28
- "@types/node": "latest",
29
- "typescript": "5.9.2",
30
- "unbuild": "3.6.1"
2
+ "name": "@meistrari/auth-core",
3
+ "version": "1.7.4",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": {
7
+ "types": "./dist/index.d.ts",
8
+ "import": "./dist/index.mjs"
31
9
  }
10
+ },
11
+ "main": "./dist/index.mjs",
12
+ "types": "./dist/index.d.ts",
13
+ "files": [
14
+ "dist"
15
+ ],
16
+ "scripts": {
17
+ "build": "unbuild"
18
+ },
19
+ "dependencies": {
20
+ "@better-auth/sso": "1.4.7",
21
+ "better-auth": "1.4.7",
22
+ "jose": "6.1.0",
23
+ "nanostores": "1.0.1",
24
+ "@better-fetch/fetch": "1.1.21",
25
+ "better-call": "1.1.5"
26
+ },
27
+ "devDependencies": {
28
+ "@types/node": "latest",
29
+ "typescript": "5.9.2",
30
+ "unbuild": "3.6.1"
31
+ }
32
32
  }