@opexa/portal-components 0.0.1013 → 0.0.1015

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.
@@ -25,6 +25,8 @@ export function RegisterBiometrics() {
25
25
  kyc: ctx.kyc,
26
26
  kycReminder: ctx.kycReminder,
27
27
  disclaimer: ctx.disclaimer,
28
+ termsOfUse: ctx.termsOfUse,
29
+ accountVerification: ctx.kycAccountVerificationRequired,
28
30
  };
29
31
  }));
30
32
  return (_jsx(Dialog.Root, { open: registerBiometricStore.open &&
@@ -32,7 +34,9 @@ export function RegisterBiometrics() {
32
34
  !responsibleGamingReminder.open &&
33
35
  !kycModals.kyc.open &&
34
36
  !kycModals.kycReminder.open &&
35
- !kycModals.disclaimer.open, children: _jsx(Portal, { children: _jsx(Dialog.Positioner, { className: "flex items-center", children: _jsxs(Dialog.Content, { className: "flex w-full min-w-[320px] max-w-md flex-col gap-4 rounded-lg border-border-brand bg-bg-secondary p-6 shadow-lg", children: [_jsx(Dialog.CloseTrigger, { onClick: () => {
37
+ !kycModals.disclaimer.open &&
38
+ !kycModals.termsOfUse.open &&
39
+ !kycModals.accountVerification.open, children: _jsx(Portal, { children: _jsx(Dialog.Positioner, { className: "flex items-center", children: _jsxs(Dialog.Content, { className: "flex w-full min-w-[320px] max-w-md flex-col gap-4 rounded-lg border-border-brand bg-bg-secondary p-6 shadow-lg", children: [_jsx(Dialog.CloseTrigger, { onClick: () => {
36
40
  registerBiometricStore.setOpen(false);
37
41
  }, children: _jsx(XIcon, {}) }), _jsx("h2", { className: "mt-4 w-full text-center font-bold text-2xl text-brand-500", children: "Register Biometric" }), _jsx("p", { className: "mt-2 grow text-center text-[#999]", children: "Would you like to setup biometric authentication?" }), _jsxs("div", { className: "flex gap-4 p-2", children: [_jsx(Button, { onClick: async () => {
38
42
  if (!account)
@@ -33,6 +33,7 @@ import { PinInput } from '../../../ui/PinInput/index.js';
33
33
  import { Select } from '../../../ui/Select/index.js';
34
34
  import { Tooltip } from '../../../ui/Tooltip/index.js';
35
35
  import { createPoll } from '../../../utils/createPoll.js';
36
+ import { isDisposableEmail } from '../../../utils/isDisposableEmail.js';
36
37
  import DateOfBirthField from '../../DateOfBirthField.js';
37
38
  import { useSignUpDefaultPropsContext } from './SignUpDefaultContext.js';
38
39
  export function SignUpDefaultForm() {
@@ -100,7 +101,12 @@ export function SignUpDefaultForm() {
100
101
  const emailAddressBaseSchema = z
101
102
  .string()
102
103
  .min(1, 'Email address is required')
103
- .email('Invalid email address');
104
+ .max(254, 'Email address must not be more than 254 characters')
105
+ .email('Invalid email address')
106
+ .refine(async (email) => {
107
+ const isDisposable = await isDisposableEmail(email);
108
+ return !isDisposable;
109
+ }, { message: 'Disposable email addresses are not allowed' });
104
110
  const Step1Definition = z.object({
105
111
  mobileNumber: z
106
112
  .string()
@@ -278,7 +284,9 @@ export function SignUpDefaultForm() {
278
284
  }),
279
285
  }),
280
286
  ...(signUpProps.showEmailAddressField && {
281
- emailAddress: step1Form.getValues('emailAddress'),
287
+ emailAddress: step1Form
288
+ .getValues('emailAddress')
289
+ ?.toLowerCase(),
282
290
  }),
283
291
  referralCode: search.get('referralCode') ?? undefined,
284
292
  });
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Checks if an email address uses a disposable email domain.
3
+ * Uses the free Kickbox Open API.
4
+ */
5
+ export declare function isDisposableEmail(email: string): Promise<boolean>;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Checks if an email address uses a disposable email domain.
3
+ * Uses the free Kickbox Open API.
4
+ */
5
+ export async function isDisposableEmail(email) {
6
+ const domain = email.split('@')[1]?.toLowerCase();
7
+ if (!domain)
8
+ return false;
9
+ try {
10
+ const response = await fetch(`https://open.kickbox.com/v1/disposable/${encodeURIComponent(domain)}`);
11
+ if (!response.ok)
12
+ return false;
13
+ const data = await response.json();
14
+ return data.disposable === true;
15
+ }
16
+ catch {
17
+ return false;
18
+ }
19
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.1013",
3
+ "version": "0.0.1015",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",