@ichaingo/auth 1.4.38 → 1.4.39

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/loginApi/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAgB,MAAM,QAAQ,CAAA;AAGhD,QAAA,MAAM,QAAQ,EAAE,SAoBf,CAAA;AACD,eAAe,QAAQ,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/loginApi/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAiC,MAAM,QAAQ,CAAA;AAGjE,QAAA,MAAM,QAAQ,EAAE,SAyBf,CAAA;AACD,eAAe,QAAQ,CAAA"}
@@ -2,10 +2,17 @@ export interface ILoginApi {
2
2
  login: (data: ILoginParams) => Promise<any>;
3
3
  getToken: () => void;
4
4
  refreshToken: () => Promise<any>;
5
+ register: (data: IRegisterParams) => Promise<any>;
5
6
  }
6
7
  export interface ILoginParams {
7
8
  email: string;
8
9
  password: string;
9
10
  [property: string]: any;
10
11
  }
12
+ export interface IRegisterParams {
13
+ email: string;
14
+ verifyCode: string;
15
+ password: string;
16
+ [property: string]: any;
17
+ }
11
18
  //# sourceMappingURL=type.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../src/loginApi/type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;CAClC;AACD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC;CACzB"}
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../src/loginApi/type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,QAAQ,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;CACnD;AACD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC;CACzB"}
package/dist/loginApi.mjs CHANGED
@@ -1,19 +1,22 @@
1
- import e from "@ichaingo/request";
2
- import r from "js-cookie";
3
- import { getToken as t, removeAllToken as i } from "@ichaingo/token";
1
+ import r from "@ichaingo/request";
2
+ import o from "js-cookie";
3
+ import { getToken as t, removeAllToken as s } from "@ichaingo/token";
4
4
  const c = {
5
- login: (o) => (i(), e.post("/api/login/email", o, {
6
- baseURL: "/"
5
+ login: (e) => (s(), r.post("/api/login/email", e, {
6
+ baseURL: process.env.NEXT_PUBLIC_AUTH_URL
7
7
  })),
8
8
  getToken: () => {
9
- r.set("Authorization", `Basic ${btoa("search-client:secret-search")}`), window.location.href = `/oauth2/authorize?client_id=search-client&response_type=code&scope=openid%20profile&state=test-state-123&redirect_uri=${window.location.origin}/callback`;
9
+ o.set("Authorization", `Basic ${btoa("search-client:secret-search")}`), window.location.href = `/oauth2/authorize?client_id=search-client&response_type=code&scope=openid%20profile&state=test-state-123&redirect_uri=${window.location.origin}/callback`;
10
10
  },
11
- refreshToken: () => e.get("/refresh/token", {
11
+ refreshToken: () => r.get("/api/refresh/token", {
12
12
  params: {
13
13
  grant_type: "refresh_token",
14
14
  refresh_token: t("refresh_token")
15
15
  },
16
- baseURL: process.env.NEXT_PUBLIC_BASE_URL
16
+ baseURL: process.env.NEXT_PUBLIC_AUTH_URL
17
+ }),
18
+ register: (e) => r.post("/api/register", e, {
19
+ baseURL: process.env.NEXT_PUBLIC_AUTH_URL
17
20
  })
18
21
  };
19
22
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ichaingo/auth",
3
- "version": "1.4.38",
3
+ "version": "1.4.39",
4
4
  "type": "module",
5
5
  "main": "./dist/index.mjs",
6
6
  "module": "./dist/index.mjs",
@@ -24,8 +24,8 @@
24
24
  ],
25
25
  "peerDependencies": {
26
26
  "js-cookie": "3.0.5",
27
- "@ichaingo/request": "1.4.38",
28
- "@ichaingo/token": "1.4.38"
27
+ "@ichaingo/token": "1.4.39",
28
+ "@ichaingo/request": "1.4.39"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/js-cookie": "^3.0.6",