Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: CORS issues in development #231

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions instrumentation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import * as Sentry from '@sentry/nextjs';

const { version, name } = require('./package.json');

export function register() {
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
tracesSampleRate: 1,
debug: false,

enabled: process.env.NODE_ENV === 'production',

// release: `${process.env.npm_package_name}@${process.env.npm_package_version}`,
release: `${name}@${version}`,
});
}
3 changes: 0 additions & 3 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
serverActions: true,
},
reactStrictMode: true,
output: 'standalone',
webpack: (config, { webpack, isServer, nextRuntime }) => {
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,20 @@
"@mui/material": "^5.15.17",
"@ory/client": "^1.9.0",
"@ory/integrations": "^1.2.1",
"@sentry/nextjs": "^7.80.0",
"@sentry/nextjs": "^8.2.1",
"@thgh/next-gtm": "^0.1.5",
"aws-amplify": "^5.3.12",
"check-password-strength": "^2.0.10",
"hibp": "^13.0.0",
"eslint": "^8.53.0",
"eslint-config-next": "^14.2.3",
"hibp": "^14.1.1",
"negotiator": "^0.6.3",
"next": "^13.5.6",
"next": "^14.2.3",
"next-recaptcha-v3": "^1.4.1",
"react": "^18.2.0",
"react-gtm-module": "^2.0.11",
"react-hook-form": "7.47.0",
"react-imask": "^7.6.0",
"sharp": "^0.32.6",
"typescript": "^5.2.2",
"zod": "^3.23.8"
},
Expand Down
2,246 changes: 1,616 additions & 630 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion sentry.client.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Sentry.init({
tracesSampleRate: 1,
debug: false,

enabled: process.env.NODE_ENV === 'production',

// release: `${process.env.npm_package_name}@${process.env.npm_package_version}`,
release: `${name}@${version}`,

Expand All @@ -16,7 +18,7 @@ Sentry.init({
replaysSessionSampleRate: 0.1,
// You can remove this option if you're not planning to use the Sentry Session Replay feature:
integrations: [
new Sentry.Replay({
Sentry.replayIntegration({
// Additional Replay configuration goes in here, for example:
maskAllText: false,
blockAllMedia: true,
Expand Down
11 changes: 0 additions & 11 deletions sentry.edge.config.ts

This file was deleted.

11 changes: 0 additions & 11 deletions sentry.server.config.ts

This file was deleted.

14 changes: 5 additions & 9 deletions src/app/[lang]/identification/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ import { CustomTextMask } from '@/components/CustomTextMask';
import { useSnackAlert } from '@/components/elements/alert';
import { ButtonApp } from '@/components/elements/button';
import { Validations } from '@/common/helpers';
import { ory } from '@/common/lib/ory';
import theme from '@/components/themes/theme';
import { useLanguage } from '../provider';
import { ory } from '@/common/lib/ory';
import { LOGIN_URL } from '@/common';

type CedulaForm = z.infer<ReturnType<typeof createCedulaSchema>>;

Expand All @@ -44,12 +45,10 @@ export function Form() {
.toSession()
.then(({ data }) => {
if (data.active) {
return router.push('https://mi.cuentaunica.gob.do/ui/login');
} else {
setLoading(false);
return router.push(LOGIN_URL);
}
})
.catch(() => setLoading(false));
.finally(() => setLoading(false));
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

Expand Down Expand Up @@ -158,10 +157,7 @@ export function Form() {
<GridContainer>
<GridItem md={12} lg={12}>
<TextBodyTiny textCenter>
<Link
href={'https://mi.cuentaunica.gob.do/ui/login'}
style={{ textDecoration: 'none' }}
>
<Link href={LOGIN_URL} style={{ textDecoration: 'none' }}>
<span style={{ color: theme.palette.primary.main }}>
{intl.alreadyRegistered}
</span>{' '}
Expand Down
1 change: 1 addition & 0 deletions src/common/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const LOGIN_URL = 'https://mi.cuentaunica.gob.do/ui/login';
8 changes: 2 additions & 6 deletions src/components/layout/navBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import styles from './styles.module.css';
import { LanguageSelector } from './languageSelector';
import { useLanguage } from '@/app/[lang]/provider';
import { ButtonApp } from '../elements/button';
import { LOGIN_URL } from '@/common';

export default function Index() {
const { intl, locales } = useLanguage();
Expand Down Expand Up @@ -45,12 +46,7 @@ export default function Index() {
<LanguageSelector
other={locales.find((l) => l !== intl.language)!}
/>
<ButtonApp
notFullWidth
onClick={() =>
window.open('https://mi.cuentaunica.gob.do/ui/login')
}
>
<ButtonApp notFullWidth onClick={() => window.open(LOGIN_URL)}>
{intl.actions.login}
</ButtonApp>
</Toolbar>
Expand Down
Loading