@dymo-api/better-auth 1.2.27 → 1.2.28

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/README.md CHANGED
@@ -31,15 +31,15 @@ You can see the library documentation by clicking [here](https://docs.tpeoficial
31
31
  Use one of the following commands to install **Dymo API** in your `TS`/`JS` project.
32
32
 
33
33
  ```bash
34
- npm i @dymo-api/better-auth
34
+ npm cache clean --force && npm i @dymo-api/better-auth
35
35
 
36
36
  # or
37
37
 
38
- pnpm i @dymo-api/better-auth
38
+ pnpm cache clean --force && pnpm i @dymo-api/better-auth
39
39
 
40
40
  # or
41
41
 
42
- yarn add @dymo-api/better-auth
42
+ yarn cache clean --force && yarn add @dymo-api/better-auth
43
43
  ```
44
44
 
45
45
  #### Authenticating ourselves on the client with the API Key
@@ -94,4 +94,14 @@ export const auth = betterAuth({
94
94
  });
95
95
  ```
96
96
 
97
- More types of validations coming soon to keep you protected.
97
+ More types of validations coming soon to keep you protected.
98
+
99
+ ## Frequently Asked Questions
100
+
101
+ <details>
102
+ <summary>Email mismatch error when logging in with Google and others</summary>
103
+
104
+ **Dymo API** normalizes the email by default, removing, for example, the `.` and `+` from the email based on the specific provider, which means that if you are not also normalizing the email in the login via OAuth, you will get a mismatch error.
105
+
106
+ To do this, you have two options: the first and correct one would be to also normalize the login email, and the second would be to disable normalization using `normalize: false`.
107
+ </details>
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.dymoEmailPlugin = void 0;
7
7
  const api_1 = require("better-auth/api");
8
8
  const dymo_api_1 = __importDefault(require("dymo-api"));
9
- const dymoEmailPlugin = ({ apiKey, applyToLogin = false, applyToOAuth = true, emailRules, normalize = true }) => {
9
+ const dymoEmailPlugin = ({ apiKey, applyToLogin = false, applyToOAuth = true, emailRules, normalize = true, resilience }) => {
10
10
  const defaultRules = {
11
11
  deny: ["FRAUD", "INVALID", "NO_MX_RECORDS", "NO_REPLY_EMAIL"]
12
12
  };
@@ -16,7 +16,8 @@ const dymoEmailPlugin = ({ apiKey, applyToLogin = false, applyToOAuth = true, em
16
16
  email: {
17
17
  deny: emailRules?.deny ?? defaultRules.deny
18
18
  }
19
- }
19
+ },
20
+ resilience
20
21
  });
21
22
  const activePaths = [
22
23
  "/sign-up/email",
@@ -7,7 +7,7 @@ exports.dymoIPPlugin = void 0;
7
7
  const api_1 = require("better-auth/api");
8
8
  const dymo_api_1 = __importDefault(require("dymo-api"));
9
9
  const ipHeaders = ["x-forwarded-for", "cf-connecting-ip", "x-vercel-forwarded-for", "x-real-ip"];
10
- const dymoIPPlugin = ({ apiKey, applyToLogin = false, applyToOAuth = true, ipRules, normalize = true }) => {
10
+ const dymoIPPlugin = ({ apiKey, applyToLogin = false, applyToOAuth = true, ipRules, normalize = true, resilience }) => {
11
11
  const defaultRules = {
12
12
  deny: ["FRAUD", "INVALID", "TOR_NETWORK"]
13
13
  };
@@ -17,7 +17,8 @@ const dymoIPPlugin = ({ apiKey, applyToLogin = false, applyToOAuth = true, ipRul
17
17
  ip: {
18
18
  deny: ipRules?.deny ?? defaultRules.deny
19
19
  }
20
- }
20
+ },
21
+ resilience
21
22
  });
22
23
  const activePaths = [
23
24
  "/sign-up/email",
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.dymoPhonePlugin = void 0;
7
7
  const api_1 = require("better-auth/api");
8
8
  const dymo_api_1 = __importDefault(require("dymo-api"));
9
- const dymoPhonePlugin = ({ apiKey, applyToLogin = false, applyToOAuth = true, phoneRules, normalize = true }) => {
9
+ const dymoPhonePlugin = ({ apiKey, applyToLogin = false, applyToOAuth = true, phoneRules, normalize = true, resilience }) => {
10
10
  const defaultRules = {
11
11
  deny: ["FRAUD", "INVALID"]
12
12
  };
@@ -16,7 +16,8 @@ const dymoPhonePlugin = ({ apiKey, applyToLogin = false, applyToOAuth = true, ph
16
16
  phone: {
17
17
  deny: phoneRules?.deny ?? defaultRules.deny
18
18
  }
19
- }
19
+ },
20
+ resilience
20
21
  });
21
22
  const activePaths = [
22
23
  "/sign-in/phone-number",
@@ -1,6 +1,6 @@
1
1
  import { APIError, createAuthMiddleware } from "better-auth/api";
2
2
  import DymoAPI from "dymo-api";
3
- export const dymoEmailPlugin = ({ apiKey, applyToLogin = false, applyToOAuth = true, emailRules, normalize = true }) => {
3
+ export const dymoEmailPlugin = ({ apiKey, applyToLogin = false, applyToOAuth = true, emailRules, normalize = true, resilience }) => {
4
4
  const defaultRules = {
5
5
  deny: ["FRAUD", "INVALID", "NO_MX_RECORDS", "NO_REPLY_EMAIL"]
6
6
  };
@@ -10,7 +10,8 @@ export const dymoEmailPlugin = ({ apiKey, applyToLogin = false, applyToOAuth = t
10
10
  email: {
11
11
  deny: emailRules?.deny ?? defaultRules.deny
12
12
  }
13
- }
13
+ },
14
+ resilience
14
15
  });
15
16
  const activePaths = [
16
17
  "/sign-up/email",
@@ -1,7 +1,7 @@
1
1
  import { APIError, createAuthMiddleware } from "better-auth/api";
2
2
  import DymoAPI from "dymo-api";
3
3
  const ipHeaders = ["x-forwarded-for", "cf-connecting-ip", "x-vercel-forwarded-for", "x-real-ip"];
4
- export const dymoIPPlugin = ({ apiKey, applyToLogin = false, applyToOAuth = true, ipRules, normalize = true }) => {
4
+ export const dymoIPPlugin = ({ apiKey, applyToLogin = false, applyToOAuth = true, ipRules, normalize = true, resilience }) => {
5
5
  const defaultRules = {
6
6
  deny: ["FRAUD", "INVALID", "TOR_NETWORK"]
7
7
  };
@@ -11,7 +11,8 @@ export const dymoIPPlugin = ({ apiKey, applyToLogin = false, applyToOAuth = true
11
11
  ip: {
12
12
  deny: ipRules?.deny ?? defaultRules.deny
13
13
  }
14
- }
14
+ },
15
+ resilience
15
16
  });
16
17
  const activePaths = [
17
18
  "/sign-up/email",
@@ -1,6 +1,6 @@
1
1
  import { APIError, createAuthMiddleware } from "better-auth/api";
2
2
  import DymoAPI from "dymo-api";
3
- export const dymoPhonePlugin = ({ apiKey, applyToLogin = false, applyToOAuth = true, phoneRules, normalize = true }) => {
3
+ export const dymoPhonePlugin = ({ apiKey, applyToLogin = false, applyToOAuth = true, phoneRules, normalize = true, resilience }) => {
4
4
  const defaultRules = {
5
5
  deny: ["FRAUD", "INVALID"]
6
6
  };
@@ -10,7 +10,8 @@ export const dymoPhonePlugin = ({ apiKey, applyToLogin = false, applyToOAuth = t
10
10
  phone: {
11
11
  deny: phoneRules?.deny ?? defaultRules.deny
12
12
  }
13
- }
13
+ },
14
+ resilience
14
15
  });
15
16
  const activePaths = [
16
17
  "/sign-in/phone-number",
@@ -1,12 +1,13 @@
1
- import { EmailValidatorRules } from "dymo-api";
1
+ import { EmailValidatorRules, ResilienceConfig } from "dymo-api";
2
2
  interface DymoEmailPluginOptions {
3
3
  apiKey: string;
4
4
  applyToLogin?: boolean;
5
5
  applyToOAuth?: boolean;
6
6
  emailRules?: Partial<EmailValidatorRules>;
7
7
  normalize?: boolean;
8
+ resilience?: ResilienceConfig;
8
9
  }
9
- export declare const dymoEmailPlugin: ({ apiKey, applyToLogin, applyToOAuth, emailRules, normalize }: DymoEmailPluginOptions) => {
10
+ export declare const dymoEmailPlugin: ({ apiKey, applyToLogin, applyToOAuth, emailRules, normalize, resilience }: DymoEmailPluginOptions) => {
10
11
  id: "dymoEmailPlugin";
11
12
  hooks: {
12
13
  before: {
@@ -1,12 +1,13 @@
1
- import { IPValidatorRules } from "dymo-api";
1
+ import { IPValidatorRules, ResilienceConfig } from "dymo-api";
2
2
  interface dymoIPPluginOptions {
3
3
  apiKey: string;
4
4
  applyToLogin?: boolean;
5
5
  applyToOAuth?: boolean;
6
6
  ipRules?: Partial<IPValidatorRules>;
7
7
  normalize?: boolean;
8
+ resilience?: ResilienceConfig;
8
9
  }
9
- export declare const dymoIPPlugin: ({ apiKey, applyToLogin, applyToOAuth, ipRules, normalize }: dymoIPPluginOptions) => {
10
+ export declare const dymoIPPlugin: ({ apiKey, applyToLogin, applyToOAuth, ipRules, normalize, resilience }: dymoIPPluginOptions) => {
10
11
  id: "dymoIPPlugin";
11
12
  hooks: {
12
13
  before: {
@@ -1,12 +1,13 @@
1
- import { PhoneValidatorRules } from "dymo-api";
1
+ import { PhoneValidatorRules, ResilienceConfig } from "dymo-api";
2
2
  interface DymoPhonePluginOptions {
3
3
  apiKey: string;
4
4
  applyToLogin?: boolean;
5
5
  applyToOAuth?: boolean;
6
6
  phoneRules?: Partial<PhoneValidatorRules>;
7
7
  normalize?: boolean;
8
+ resilience?: ResilienceConfig;
8
9
  }
9
- export declare const dymoPhonePlugin: ({ apiKey, applyToLogin, applyToOAuth, phoneRules, normalize }: DymoPhonePluginOptions) => {
10
+ export declare const dymoPhonePlugin: ({ apiKey, applyToLogin, applyToOAuth, phoneRules, normalize, resilience }: DymoPhonePluginOptions) => {
10
11
  id: "dymoPhonePlugin";
11
12
  hooks: {
12
13
  before: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dymo-api/better-auth",
3
- "version": "1.2.27",
3
+ "version": "1.2.28",
4
4
  "description": "Flow system for Dymo API.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -59,7 +59,7 @@
59
59
  "homepage": "https://dymo.tpeoficial.com",
60
60
  "dependencies": {
61
61
  "better-auth": "^1.3.23",
62
- "dymo-api": "^1.2.30",
62
+ "dymo-api": "^1.2.32",
63
63
  "path": "^0.12.7"
64
64
  },
65
65
  "contributors": [