@alore/auth-react-ui 1.1.1-alpha.1 → 1.2.0-alpha.10

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.
Files changed (43) hide show
  1. package/dist/cjs/auth/Login.js +95 -44
  2. package/dist/cjs/auth/Login.js.map +1 -1
  3. package/dist/cjs/auth/Register.js +118 -69
  4. package/dist/cjs/auth/Register.js.map +1 -1
  5. package/dist/cjs/components/Auth.d.ts +7 -1
  6. package/dist/cjs/components/Auth.js +54 -6
  7. package/dist/cjs/components/Auth.js.map +1 -1
  8. package/dist/cjs/components/AuthProvider.d.ts +23 -1
  9. package/dist/cjs/components/AuthProvider.js.map +1 -1
  10. package/dist/cjs/dictionaries/en.json +1 -0
  11. package/dist/cjs/dictionaries/pt.json +1 -0
  12. package/dist/cjs/get-dictionary.d.ts +3 -0
  13. package/dist/cjs/hooks/useAuthService.d.ts +66 -0
  14. package/dist/cjs/hooks/useAuthServiceInstance.d.ts +22 -0
  15. package/dist/cjs/hooks/useDictionary.d.ts +1 -0
  16. package/dist/cjs/index.d.ts +3 -3
  17. package/dist/cjs/index.js.map +1 -1
  18. package/dist/cjs/machine/index.d.ts +44 -0
  19. package/dist/cjs/machine/index.js +180 -58
  20. package/dist/cjs/machine/index.js.map +1 -1
  21. package/dist/cjs/machine/types.d.ts +18 -2
  22. package/dist/mjs/auth/Login.js +76 -30
  23. package/dist/mjs/auth/Login.js.map +1 -1
  24. package/dist/mjs/auth/Register.js +54 -12
  25. package/dist/mjs/auth/Register.js.map +1 -1
  26. package/dist/mjs/components/Auth.d.ts +7 -1
  27. package/dist/mjs/components/Auth.js +54 -6
  28. package/dist/mjs/components/Auth.js.map +1 -1
  29. package/dist/mjs/components/AuthProvider.d.ts +23 -1
  30. package/dist/mjs/components/AuthProvider.js.map +1 -1
  31. package/dist/mjs/dictionaries/en.json +1 -0
  32. package/dist/mjs/dictionaries/pt.json +1 -0
  33. package/dist/mjs/get-dictionary.d.ts +3 -0
  34. package/dist/mjs/hooks/useAuthService.d.ts +66 -0
  35. package/dist/mjs/hooks/useAuthServiceInstance.d.ts +22 -0
  36. package/dist/mjs/hooks/useDictionary.d.ts +1 -0
  37. package/dist/mjs/index.d.ts +3 -3
  38. package/dist/mjs/index.js.map +1 -1
  39. package/dist/mjs/machine/index.d.ts +44 -0
  40. package/dist/mjs/machine/index.js +164 -65
  41. package/dist/mjs/machine/index.js.map +1 -1
  42. package/dist/mjs/machine/types.d.ts +18 -2
  43. package/package.json +5 -4
@@ -25,6 +25,7 @@
25
25
  "continueMicrosoft": "Microsoft",
26
26
  "signWithPasskey": "Sign in with a passkey",
27
27
  "continueApple": "Continue with Apple",
28
+ "emailDomainNotAllowed": "Email domain not allowed",
28
29
  "layout": {
29
30
  "default": {
30
31
  "title": "Where user experience and DeFi meets.",
@@ -25,6 +25,7 @@
25
25
  "continueMicrosoft": "Microsoft",
26
26
  "signWithPasskey": "Entrar com uma passkey",
27
27
  "continueApple": "Continuar com a Apple",
28
+ "emailDomainNotAllowed": "Domínio de e-mail não permitido",
28
29
  "layout": {
29
30
  "default": {
30
31
  "title": "Onde a experiência do usuário e DeFi se encontram.",
@@ -31,6 +31,7 @@ export declare const dictionaries: {
31
31
  continueMicrosoft: string;
32
32
  signWithPasskey: string;
33
33
  continueApple: string;
34
+ emailDomainNotAllowed: string;
34
35
  layout: {
35
36
  default: {
36
37
  title: string;
@@ -157,6 +158,7 @@ export declare const dictionaries: {
157
158
  continueMicrosoft: string;
158
159
  signWithPasskey: string;
159
160
  continueApple: string;
161
+ emailDomainNotAllowed: string;
160
162
  layout: {
161
163
  default: {
162
164
  title: string;
@@ -284,6 +286,7 @@ export declare const getDictionary: (locale: Locale) => Promise<{
284
286
  continueMicrosoft: string;
285
287
  signWithPasskey: string;
286
288
  continueApple: string;
289
+ emailDomainNotAllowed: string;
287
290
  layout: {
288
291
  default: {
289
292
  title: string;
@@ -5,6 +5,17 @@ declare const useAuthService: () => readonly [import("xstate").State<import("../
5
5
  type: "RESET";
6
6
  } | {
7
7
  type: "RESET_CONTEXT";
8
+ } | {
9
+ type: "SET_ERROR";
10
+ error?: string | undefined;
11
+ info?: {
12
+ code?: string | undefined;
13
+ message?: string | undefined;
14
+ email?: string | undefined;
15
+ data?: any;
16
+ } | undefined;
17
+ } | {
18
+ type: "CLEAR_ERROR";
8
19
  } | {
9
20
  type: "REFRESH_ACCESS_TOKEN";
10
21
  newAccessToken: string;
@@ -250,6 +261,17 @@ declare const useAuthService: () => readonly [import("xstate").State<import("../
250
261
  type: "RESET";
251
262
  } | {
252
263
  type: "RESET_CONTEXT";
264
+ } | {
265
+ type: "SET_ERROR";
266
+ error?: string | undefined;
267
+ info?: {
268
+ code?: string | undefined;
269
+ message?: string | undefined;
270
+ email?: string | undefined;
271
+ data?: any;
272
+ } | undefined;
273
+ } | {
274
+ type: "CLEAR_ERROR";
253
275
  } | {
254
276
  type: "REFRESH_ACCESS_TOKEN";
255
277
  newAccessToken: string;
@@ -492,6 +514,17 @@ declare const useAuthService: () => readonly [import("xstate").State<import("../
492
514
  type: "RESET";
493
515
  } | {
494
516
  type: "RESET_CONTEXT";
517
+ } | {
518
+ type: "SET_ERROR";
519
+ error?: string | undefined;
520
+ info?: {
521
+ code?: string | undefined;
522
+ message?: string | undefined;
523
+ email?: string | undefined;
524
+ data?: any;
525
+ } | undefined;
526
+ } | {
527
+ type: "CLEAR_ERROR";
495
528
  } | {
496
529
  type: "REFRESH_ACCESS_TOKEN";
497
530
  newAccessToken: string;
@@ -734,6 +767,17 @@ declare const useAuthService: () => readonly [import("xstate").State<import("../
734
767
  type: "RESET";
735
768
  } | {
736
769
  type: "RESET_CONTEXT";
770
+ } | {
771
+ type: "SET_ERROR";
772
+ error?: string | undefined;
773
+ info?: {
774
+ code?: string | undefined;
775
+ message?: string | undefined;
776
+ email?: string | undefined;
777
+ data?: any;
778
+ } | undefined;
779
+ } | {
780
+ type: "CLEAR_ERROR";
737
781
  } | {
738
782
  type: "REFRESH_ACCESS_TOKEN";
739
783
  newAccessToken: string;
@@ -976,6 +1020,17 @@ declare const useAuthService: () => readonly [import("xstate").State<import("../
976
1020
  type: "RESET";
977
1021
  } | {
978
1022
  type: "RESET_CONTEXT";
1023
+ } | {
1024
+ type: "SET_ERROR";
1025
+ error?: string | undefined;
1026
+ info?: {
1027
+ code?: string | undefined;
1028
+ message?: string | undefined;
1029
+ email?: string | undefined;
1030
+ data?: any;
1031
+ } | undefined;
1032
+ } | {
1033
+ type: "CLEAR_ERROR";
979
1034
  } | {
980
1035
  type: "REFRESH_ACCESS_TOKEN";
981
1036
  newAccessToken: string;
@@ -1221,6 +1276,17 @@ declare const useAuthService: () => readonly [import("xstate").State<import("../
1221
1276
  type: "RESET";
1222
1277
  } | {
1223
1278
  type: "RESET_CONTEXT";
1279
+ } | {
1280
+ type: "SET_ERROR";
1281
+ error?: string | undefined;
1282
+ info?: {
1283
+ code?: string | undefined;
1284
+ message?: string | undefined;
1285
+ email?: string | undefined;
1286
+ data?: any;
1287
+ } | undefined;
1288
+ } | {
1289
+ type: "CLEAR_ERROR";
1224
1290
  } | {
1225
1291
  type: "REFRESH_ACCESS_TOKEN";
1226
1292
  newAccessToken: string;
@@ -5,6 +5,17 @@ declare const useAuthServiceInstance: () => import("xstate").Interpreter<import(
5
5
  type: "RESET";
6
6
  } | {
7
7
  type: "RESET_CONTEXT";
8
+ } | {
9
+ type: "SET_ERROR";
10
+ error?: string | undefined;
11
+ info?: {
12
+ code?: string | undefined;
13
+ message?: string | undefined;
14
+ email?: string | undefined;
15
+ data?: any;
16
+ } | undefined;
17
+ } | {
18
+ type: "CLEAR_ERROR";
8
19
  } | {
9
20
  type: "REFRESH_ACCESS_TOKEN";
10
21
  newAccessToken: string;
@@ -250,6 +261,17 @@ declare const useAuthServiceInstance: () => import("xstate").Interpreter<import(
250
261
  type: "RESET";
251
262
  } | {
252
263
  type: "RESET_CONTEXT";
264
+ } | {
265
+ type: "SET_ERROR";
266
+ error?: string | undefined;
267
+ info?: {
268
+ code?: string | undefined;
269
+ message?: string | undefined;
270
+ email?: string | undefined;
271
+ data?: any;
272
+ } | undefined;
273
+ } | {
274
+ type: "CLEAR_ERROR";
253
275
  } | {
254
276
  type: "REFRESH_ACCESS_TOKEN";
255
277
  newAccessToken: string;
@@ -26,6 +26,7 @@ declare const useDictionary: (locale: Locale) => {
26
26
  continueMicrosoft: string;
27
27
  signWithPasskey: string;
28
28
  continueApple: string;
29
+ emailDomainNotAllowed: string;
29
30
  layout: {
30
31
  default: {
31
32
  title: string;
@@ -1,10 +1,10 @@
1
- import { AuthProviderConfig } from '@alore/auth-react-sdk/dist/types';
1
+ import { AuthProviderConfig } from '@alore/auth-react-sdk';
2
2
  import Login from './auth/Login';
3
3
  import Register from './auth/Register';
4
- import Auth, { AuthProps } from './components/Auth';
4
+ import Auth, { AuthError, AuthProps } from './components/Auth';
5
5
  import { AuthProvider } from './components/AuthProvider';
6
6
  import useAuthService from './hooks/useAuthService';
7
7
  import { LocalStorageAuthState } from './machine/LocalStorageAuthState';
8
8
  import { SessionUser } from './machine/types';
9
- export type { AuthProps, SessionUser, AuthProviderConfig, LocalStorageAuthState };
9
+ export type { AuthProps, SessionUser, AuthProviderConfig, LocalStorageAuthState, AuthError };
10
10
  export { useAuthService, AuthProvider, Auth, Login, Register };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":";;;;;;AAEA,yDAAiC;AASY,gBATtC,eAAK,CASsC;AARlD,+DAAuC;AAQa,mBAR7C,kBAAQ,CAQ6C;AAP5D,6DAAoD;AAOb,eAPhC,cAAI,CAOgC;AAN3C,4DAAyD;AAMhC,6FANhB,2BAAY,OAMgB;AALrC,4EAAoD;AAK3C,yBALF,wBAAc,CAKE"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":";;;;;;AAEA,yDAAiC;AASY,gBATtC,eAAK,CASsC;AARlD,+DAAuC;AAQa,mBAR7C,kBAAQ,CAQ6C;AAP5D,6DAA+D;AAOxB,eAPhC,cAAI,CAOgC;AAN3C,4DAAyD;AAMhC,6FANhB,2BAAY,OAMgB;AALrC,4EAAoD;AAK3C,yBALF,wBAAc,CAKE"}
@@ -6,6 +6,17 @@ export declare const authMachine: import("xstate").StateMachine<AuthMachineConte
6
6
  type: "RESET";
7
7
  } | {
8
8
  type: "RESET_CONTEXT";
9
+ } | {
10
+ type: "SET_ERROR";
11
+ error?: string | undefined;
12
+ info?: {
13
+ code?: string | undefined;
14
+ message?: string | undefined;
15
+ email?: string | undefined;
16
+ data?: any;
17
+ } | undefined;
18
+ } | {
19
+ type: "CLEAR_ERROR";
9
20
  } | {
10
21
  type: "REFRESH_ACCESS_TOKEN";
11
22
  newAccessToken: string;
@@ -251,6 +262,17 @@ export declare const authMachine: import("xstate").StateMachine<AuthMachineConte
251
262
  type: "RESET";
252
263
  } | {
253
264
  type: "RESET_CONTEXT";
265
+ } | {
266
+ type: "SET_ERROR";
267
+ error?: string | undefined;
268
+ info?: {
269
+ code?: string | undefined;
270
+ message?: string | undefined;
271
+ email?: string | undefined;
272
+ data?: any;
273
+ } | undefined;
274
+ } | {
275
+ type: "CLEAR_ERROR";
254
276
  } | {
255
277
  type: "REFRESH_ACCESS_TOKEN";
256
278
  newAccessToken: string;
@@ -494,6 +516,17 @@ export declare const authService: (services: {}, context: AuthMachineContext) =>
494
516
  type: "RESET";
495
517
  } | {
496
518
  type: "RESET_CONTEXT";
519
+ } | {
520
+ type: "SET_ERROR";
521
+ error?: string | undefined;
522
+ info?: {
523
+ code?: string | undefined;
524
+ message?: string | undefined;
525
+ email?: string | undefined;
526
+ data?: any;
527
+ } | undefined;
528
+ } | {
529
+ type: "CLEAR_ERROR";
497
530
  } | {
498
531
  type: "REFRESH_ACCESS_TOKEN";
499
532
  newAccessToken: string;
@@ -739,6 +772,17 @@ export declare const authService: (services: {}, context: AuthMachineContext) =>
739
772
  type: "RESET";
740
773
  } | {
741
774
  type: "RESET_CONTEXT";
775
+ } | {
776
+ type: "SET_ERROR";
777
+ error?: string | undefined;
778
+ info?: {
779
+ code?: string | undefined;
780
+ message?: string | undefined;
781
+ email?: string | undefined;
782
+ data?: any;
783
+ } | undefined;
784
+ } | {
785
+ type: "CLEAR_ERROR";
742
786
  } | {
743
787
  type: "REFRESH_ACCESS_TOKEN";
744
788
  newAccessToken: string;