@auditauth/core 0.2.0-beta.4 → 0.2.0-beta.5

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.
@@ -31,7 +31,10 @@ const authorizeCode = async ({ code, client_type }) => {
31
31
  credentials: "include"
32
32
  });
33
33
  if (!response.ok) {
34
- throw new Error("Unauthorized");
34
+ const errorMessage = await response.text().catch(() => "Unauthorized");
35
+ const error = new Error(errorMessage || "Unauthorized");
36
+ Object.assign(error, { status: response.status });
37
+ throw error;
35
38
  }
36
39
  const data = await response.json();
37
40
  return {
@@ -8,7 +8,10 @@ const authorizeCode = async ({ code, client_type }) => {
8
8
  credentials: "include"
9
9
  });
10
10
  if (!response.ok) {
11
- throw new Error("Unauthorized");
11
+ const errorMessage = await response.text().catch(() => "Unauthorized");
12
+ const error = new Error(errorMessage || "Unauthorized");
13
+ Object.assign(error, { status: response.status });
14
+ throw error;
12
15
  }
13
16
  const data = await response.json();
14
17
  return {
package/dist/settings.cjs CHANGED
@@ -27,7 +27,7 @@ const PROD_DOMAINS = {
27
27
  };
28
28
  const LOCAL_DOMAINS = {
29
29
  api: "http://localhost:4000/v1",
30
- client: "http://localhost:3000"
30
+ client: "https://localhost:3000"
31
31
  };
32
32
  const resolveImportMeta = () => {
33
33
  try {
@@ -2,11 +2,11 @@ declare const CORE_SETTINGS: {
2
2
  readonly jwt_public_key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs2EYs4Q9OyjNuAEPqb4j\nIzc52JdfVcNvEbG43Xp8B2kI9QxwRyX7rtFSwKowj3W1BlCLaTIMK3TafWOf9QwH\nfemuL9Ni37PFcGptzpyuoCYYA650EuD82PENcO49lsObvty2cuXxQszbPPvAecm4\nJ/XG70td/W1UwbjAJcdmp8ktZGYR0JXM37hYA9Xq/aKwu7d0FTL6WdKTvt3L5VxL\nF6WNyLs65ZSbu+j8UEkwmoJ9h9Y0mLQmFtmkoh/HWOFyFDnBNiJX0vRb++RhJw6w\ncrSbqpbTu7z4vIep5lgSOut39P273SVTQZ3cGQIS+605Ur5wjkkSzzaJV1QLBBR9\nAQIDAQAB\n-----END PUBLIC KEY-----\n";
3
3
  readonly jwt_issuer: "https://api.auditauth.com";
4
4
  readonly domains: {
5
- readonly api: "http://localhost:4000/v1";
6
- readonly client: "http://localhost:3000";
7
- } | {
8
5
  readonly api: "https://api.auditauth.com/v1";
9
6
  readonly client: "https://auditauth.com";
7
+ } | {
8
+ readonly api: "http://localhost:4000/v1";
9
+ readonly client: "https://localhost:3000";
10
10
  };
11
11
  readonly storage_keys: {
12
12
  readonly access: "auditauth_access";
@@ -2,11 +2,11 @@ declare const CORE_SETTINGS: {
2
2
  readonly jwt_public_key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs2EYs4Q9OyjNuAEPqb4j\nIzc52JdfVcNvEbG43Xp8B2kI9QxwRyX7rtFSwKowj3W1BlCLaTIMK3TafWOf9QwH\nfemuL9Ni37PFcGptzpyuoCYYA650EuD82PENcO49lsObvty2cuXxQszbPPvAecm4\nJ/XG70td/W1UwbjAJcdmp8ktZGYR0JXM37hYA9Xq/aKwu7d0FTL6WdKTvt3L5VxL\nF6WNyLs65ZSbu+j8UEkwmoJ9h9Y0mLQmFtmkoh/HWOFyFDnBNiJX0vRb++RhJw6w\ncrSbqpbTu7z4vIep5lgSOut39P273SVTQZ3cGQIS+605Ur5wjkkSzzaJV1QLBBR9\nAQIDAQAB\n-----END PUBLIC KEY-----\n";
3
3
  readonly jwt_issuer: "https://api.auditauth.com";
4
4
  readonly domains: {
5
- readonly api: "http://localhost:4000/v1";
6
- readonly client: "http://localhost:3000";
7
- } | {
8
5
  readonly api: "https://api.auditauth.com/v1";
9
6
  readonly client: "https://auditauth.com";
7
+ } | {
8
+ readonly api: "http://localhost:4000/v1";
9
+ readonly client: "https://localhost:3000";
10
10
  };
11
11
  readonly storage_keys: {
12
12
  readonly access: "auditauth_access";
package/dist/settings.js CHANGED
@@ -4,7 +4,7 @@ const PROD_DOMAINS = {
4
4
  };
5
5
  const LOCAL_DOMAINS = {
6
6
  api: "http://localhost:4000/v1",
7
- client: "http://localhost:3000"
7
+ client: "https://localhost:3000"
8
8
  };
9
9
  const resolveImportMeta = () => {
10
10
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auditauth/core",
3
- "version": "0.2.0-beta.4",
3
+ "version": "0.2.0-beta.5",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Nimibyte",