@opexa/portal-components 0.0.71 → 0.0.73

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.
@@ -103,7 +103,7 @@ export function NameAndPasswordSignIn() {
103
103
  signInMutation.reset();
104
104
  form.setValue('secretAnswer', '');
105
105
  },
106
- }) }), _jsx(Field.ErrorText, { children: form.formState.errors.name?.message })] }), _jsxs(Field.Root, { disabled: !!signInMutation.data, invalid: !!form.formState.errors.name, className: "mt-xl", children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter your password", ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] }), _jsx("div", { className: "mt-2 flex justify-end", children: _jsx("button", { type: "button", tabIndex: -1, className: "text-button-tertiary-fg text-sm font-semibold", children: "Forgot Password" }) })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), signInMutation.data && (_jsxs(Field.Root, { invalid: !!form.formState.errors.secretAnswer, className: "mt-xl", children: [_jsx(Field.Label, { children: secretQuestion }), _jsx(Field.Input, { placeholder: "Answer the security question", ...form.register('secretAnswer') }), _jsx(Field.ErrorText, { children: form.formState.errors.secretAnswer?.message })] })), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: signInMutation.isPending || authenticateMutation.isPending, children: "Log In" }), _jsx(Controller, { control: form.control, name: "termsAccepted", render: (o) => (_jsxs(Checkbox.Root, { className: "mt-xl", invalid: o.fieldState.invalid, checked: o.field.value, onCheckedChange: (details) => {
106
+ }) }), _jsx(Field.ErrorText, { children: form.formState.errors.name?.message })] }), _jsx(Field.Root, { disabled: !!signInMutation.data, invalid: !!form.formState.errors.name, className: "mt-xl", children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs("div", { children: [_jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter your password", ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsx("div", { className: "mt-2 flex justify-end", children: _jsx("button", { type: "button", tabIndex: -1, className: "text-button-tertiary-fg text-sm font-semibold", children: "Forgot Password" }) })] }) }), signInMutation.data && (_jsxs(Field.Root, { invalid: !!form.formState.errors.secretAnswer, className: "mt-xl", children: [_jsx(Field.Label, { children: secretQuestion }), _jsx(Field.Input, { placeholder: "Answer the security question", ...form.register('secretAnswer') }), _jsx(Field.ErrorText, { children: form.formState.errors.secretAnswer?.message })] })), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: signInMutation.isPending || authenticateMutation.isPending, children: "Log In" }), _jsx(Controller, { control: form.control, name: "termsAccepted", render: (o) => (_jsxs(Checkbox.Root, { className: "mt-xl", invalid: o.fieldState.invalid, checked: o.field.value, onCheckedChange: (details) => {
107
107
  o.field.onChange(details.checked);
108
108
  }, children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsxs(Checkbox.Label, { children: ["I am at least 21 years of age and I accept the", ' ', _jsx("span", { className: "text-brand-400 whitespace-nowrap underline underline-offset-2", children: "Terms and Conditions." })] }), _jsx(Checkbox.HiddenInput, {})] })) })] }), _jsxs("div", { className: "relative mt-6 text-center", children: [_jsx("hr", { className: "-translte-y-1/2 text-text-tertiary-600/50 absolute top-1/2 w-full" }), _jsx("span", { className: "text-text-tertiary-600 bg-bg-primary-alt relative px-md text-center text-sm font-semibold", children: "Log in directly with" })] }), _jsxs("div", { className: "mt-6", children: [_jsxs(Button, { variant: "outline", colorScheme: "gray", onClick: () => {
109
109
  dialog.setOpen(false);
@@ -3,14 +3,19 @@ import bgaming from '../images/game-providers/BGAMING.png';
3
3
  import booongo from '../images/game-providers/BOOOONGO.png';
4
4
  import bti from '../images/game-providers/BTI.png';
5
5
  import cq9 from '../images/game-providers/CQ9.png';
6
+ import darwin from '../images/game-providers/DARWIN.png';
6
7
  import dg from '../images/game-providers/DG.png';
8
+ import drbingo from '../images/game-providers/DRBINGO.png';
7
9
  import e2e from '../images/game-providers/E2E.png';
10
+ import evolution from '../images/game-providers/EVOLUTION.png';
8
11
  import evolutionNetent from '../images/game-providers/EVOLUTION_NETENT.png';
12
+ import evolutionRedTiger from '../images/game-providers/EVOLUTION_REDTIGER.png';
9
13
  import evoplay from '../images/game-providers/EVOPLAY.png';
10
14
  import ezugi from '../images/game-providers/EZUGI.png';
11
15
  import fachai from '../images/game-providers/FACHAI.png';
12
16
  import habanero from '../images/game-providers/HABANERO.png';
13
17
  import hacksaw from '../images/game-providers/HACKSAW.png';
18
+ import hollywoodtv from '../images/game-providers/HOLLYWOODTV.png';
14
19
  import jdb from '../images/game-providers/JDB.png';
15
20
  import jdbGtf from '../images/game-providers/JDB_GTF.png';
16
21
  import jdbSpribe from '../images/game-providers/JDB_SPRIBE.png';
@@ -18,12 +23,15 @@ import jili from '../images/game-providers/JILI.png';
18
23
  import joker from '../images/game-providers/JOKER.png';
19
24
  import kingmaker from '../images/game-providers/KINGMAKER.png';
20
25
  import kingmidas from '../images/game-providers/KINGMIDAS.png';
26
+ import mega2spin from '../images/game-providers/MEGA2SPIN.png';
27
+ import megaball from '../images/game-providers/MEGABALL.png';
21
28
  import microgaming from '../images/game-providers/MICROGAMING.png';
22
29
  import oneapi from '../images/game-providers/ONEAPI.png';
23
30
  import pgsoft from '../images/game-providers/PGSOFT.png';
24
31
  import playtech from '../images/game-providers/PLAYTECH.png';
25
32
  import pragmaticplay from '../images/game-providers/PRAGMATIC_PLAY.png';
26
33
  import relaxgaming from '../images/game-providers/RELAX_GAMING.png';
34
+ import rtg from '../images/game-providers/RTG.png';
27
35
  import saba from '../images/game-providers/SABA.png';
28
36
  import spinix from '../images/game-providers/SPINIX.png';
29
37
  import spribe from '../images/game-providers/SPRIBE.png';
@@ -69,7 +77,7 @@ export const GAME_PROVIDER_DATA = {
69
77
  id: 'DARWIN',
70
78
  name: 'Darwin',
71
79
  slug: 'darwin',
72
- logo: '' /* FIXME */,
80
+ logo: darwin,
73
81
  },
74
82
  DG: {
75
83
  id: 'DG',
@@ -81,7 +89,7 @@ export const GAME_PROVIDER_DATA = {
81
89
  id: 'DRBINGO',
82
90
  name: 'DrBingo',
83
91
  slug: 'drbingo',
84
- logo: '' /* FIXME */,
92
+ logo: drbingo,
85
93
  },
86
94
  E2E: {
87
95
  id: 'E2E',
@@ -99,13 +107,13 @@ export const GAME_PROVIDER_DATA = {
99
107
  id: 'EVOLUTION',
100
108
  name: 'Evolution',
101
109
  slug: 'evolution',
102
- logo: '' /* FIXME */,
110
+ logo: evolution,
103
111
  },
104
112
  EVOLUTION_REDTIGER: {
105
113
  id: 'EVOLUTION_REDTIGER',
106
114
  name: 'Evolution RedTiger',
107
115
  slug: 'evolution-redtiger',
108
- logo: '' /* FIXME */,
116
+ logo: evolutionRedTiger,
109
117
  },
110
118
  EZUGI: {
111
119
  id: 'EZUGI',
@@ -135,7 +143,7 @@ export const GAME_PROVIDER_DATA = {
135
143
  id: 'HOLLYWOODTV',
136
144
  name: 'HollywoodTV',
137
145
  slug: 'hollywoodtv',
138
- logo: '' /* FIXME */,
146
+ logo: hollywoodtv,
139
147
  },
140
148
  JDB: {
141
149
  id: 'JDB',
@@ -189,7 +197,7 @@ export const GAME_PROVIDER_DATA = {
189
197
  id: 'MEGA2SPIN',
190
198
  name: 'Mega2Spin',
191
199
  slug: 'mega2spin',
192
- logo: '' /* FIXME */,
200
+ logo: mega2spin,
193
201
  },
194
202
  MICROGAMING: {
195
203
  id: 'MICROGAMING',
@@ -201,7 +209,7 @@ export const GAME_PROVIDER_DATA = {
201
209
  id: 'MEGABALL',
202
210
  name: 'MegaBall',
203
211
  slug: 'megaball',
204
- logo: '' /* FIXME */,
212
+ logo: megaball,
205
213
  },
206
214
  ONEAPI_EVOLUTION: {
207
215
  id: 'ONEAPI_EVOLUTION',
@@ -237,7 +245,7 @@ export const GAME_PROVIDER_DATA = {
237
245
  id: 'RTG',
238
246
  name: 'RTG',
239
247
  slug: 'rtg',
240
- logo: '' /* FIXME */,
248
+ logo: rtg,
241
249
  },
242
250
  SABA: {
243
251
  id: 'SABA',
@@ -1,6 +1,7 @@
1
- import { type NextRequest, NextResponse } from 'next/server';
1
+ import { NextFetchEvent, type NextMiddleware, type NextRequest, NextResponse } from 'next/server';
2
2
  export declare const config: {
3
3
  runtime: string;
4
4
  matcher: string[];
5
5
  };
6
- export declare function middleware(request: NextRequest): Promise<NextResponse<unknown>>;
6
+ export declare const middleware: (req: NextRequest) => Promise<NextResponse>;
7
+ export declare function extendMiddleware<T>(fn: (req: NextRequest, evt: NextFetchEvent, res: NextResponse) => NextResponse<T> | Promise<NextResponse<T>>): NextMiddleware;
@@ -1,6 +1,6 @@
1
1
  import { refreshSession } from '@opexa/portal-sdk-core';
2
2
  import { addMinutes } from 'date-fns';
3
- import { NextResponse } from 'next/server';
3
+ import { NextFetchEvent, NextResponse, } from 'next/server';
4
4
  import { ACCESS_TOKEN_COOKIE_NAME, ENVIRONMENT, REFRESH_TOKEN_COOKIE_NAME, } from './constants/index.js';
5
5
  export const config = {
6
6
  runtime: 'nodejs',
@@ -8,9 +8,9 @@ export const config = {
8
8
  '/((?!api|_next/static|_next/image|favicon.ico|sitemap.xml|robots.txt).*)',
9
9
  ],
10
10
  };
11
- export async function middleware(request) {
12
- const accessToken = request.cookies.get(ACCESS_TOKEN_COOKIE_NAME)?.value;
13
- const refreshToken = request.cookies.get(REFRESH_TOKEN_COOKIE_NAME)?.value;
11
+ export const middleware = async (req) => {
12
+ const accessToken = req.cookies.get(ACCESS_TOKEN_COOKIE_NAME)?.value;
13
+ const refreshToken = req.cookies.get(REFRESH_TOKEN_COOKIE_NAME)?.value;
14
14
  const response = NextResponse.next();
15
15
  if (!accessToken && refreshToken) {
16
16
  try {
@@ -31,4 +31,7 @@ export async function middleware(request) {
31
31
  }
32
32
  }
33
33
  return response;
34
+ };
35
+ export function extendMiddleware(fn) {
36
+ return async (req, evt) => fn(req, evt, await middleware(req));
34
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.71",
3
+ "version": "0.0.73",
4
4
  "exports": {
5
5
  ".": {
6
6
  "types": "./dist/components/index.d.ts",