Compare commits

..
9 changed files with 94 additions and 15 deletions
+1 -12
View File
@@ -68,7 +68,7 @@ async function handler(
cookieStore.set(REFRESH_TOKEN, refreshToken, {
httpOnly: true,
sameSite: "strict",
domain: getCookieDomain(),
domain: COOKIE_DOMAIN,
path: "/",
});
}
@@ -92,14 +92,3 @@ export async function PUT(request: Request, props: { params: Promise<{ url: stri
const params = await props.params;
return handler(request, params, "PUT");
}
function getCookieDomain(): string | undefined {
if (typeof window === "undefined") return undefined;
if (COOKIE_DOMAIN) return COOKIE_DOMAIN;
const { hostname } = window.location;
if (hostname === "localhost" || hostname === "127.0.0.1") return undefined;
return hostname;
}
+13
View File
@@ -0,0 +1,13 @@
import * as Sentry from "@sentry/nextjs";
export const onRouterTransitionStart = Sentry.captureRouterTransitionStart;
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT ?? "local",
tracesSampleRate: 1.0,
replaysSessionSampleRate: 1.0,
replaysOnErrorSampleRate: 1.0,
integrations: [Sentry.replayIntegration()],
debug: process.env.NEXT_PUBLIC_SENTRY_DEBUG === "true",
});
+13
View File
@@ -0,0 +1,13 @@
import * as Sentry from "@sentry/nextjs";
export async function register() {
if (process.env.NEXT_RUNTIME === "nodejs") {
await import("./sentry.server.config");
}
if (process.env.NEXT_RUNTIME === "edge") {
await import("./sentry.edge.config");
}
}
export const onRequestError = Sentry.captureRequestError;
+17 -1
View File
@@ -1,8 +1,24 @@
import type { NextConfig } from "next";
import { withSentryConfig } from "@sentry/nextjs";
import path from "path";
const nextConfig: NextConfig = {
reactStrictMode: true,
transpilePackages: ["@common/assets"],
outputFileTracingRoot: path.join(__dirname, "../../"),
};
export default nextConfig;
export default withSentryConfig(nextConfig, {
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
silent: true,
widenClientFileUpload: true,
tunnelRoute: "/monitoring",
webpack: {
treeshake: {
removeDebugLogging: process.env.NEXT_PUBLIC_SENTRY_DEBUG === "true" ? false : true,
},
automaticVercelMonitors: false,
},
});
+7
View File
@@ -21,6 +21,13 @@
"@frontend-opensource/use-react-hooks": "^1.1.4",
"@hookform/resolvers": "^4.1.3",
"@radix-ui/react-tooltip": "^1.2.8",
"@opentelemetry/api": "^1.9.1",
"@opentelemetry/context-zone": "^2.8.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.219.0",
"@opentelemetry/instrumentation-fetch": "^0.219.0",
"@opentelemetry/instrumentation-xml-http-request": "^0.219.0",
"@opentelemetry/sdk-trace-web": "^2.8.0",
"@sentry/nextjs": "^10.57.0",
"@tanstack/react-query": "^5.75.5",
"@tanstack/react-query-devtools": "^5.75.5",
"@tanstack/react-table": "^8.21.2",
+8
View File
@@ -0,0 +1,8 @@
import * as Sentry from "@sentry/nextjs";
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT ?? "local",
tracesSampleRate: 1.0,
debug: process.env.NEXT_PUBLIC_SENTRY_DEBUG === "true",
});
+8
View File
@@ -0,0 +1,8 @@
import * as Sentry from "@sentry/nextjs";
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT ?? "local",
tracesSampleRate: 1.0,
debug: process.env.NEXT_PUBLIC_SENTRY_DEBUG === "true",
});
-2
View File
@@ -2,7 +2,6 @@ import {
ACCESS_TOKEN,
AUTH_USER_ID,
CLAIM_NAME,
COOKIE_DOMAIN,
REFRESH_TOKEN,
SERVER_API_URL,
SITE_ID,
@@ -136,7 +135,6 @@ async function handler(
cookieStore.set(REFRESH_TOKEN, refreshToken, {
httpOnly: true,
sameSite: "lax",
domain: COOKIE_DOMAIN,
path: "/",
});
}
+27
View File
@@ -0,0 +1,27 @@
# apps/st/src/shared/config/env.ts 참고
NEXT_PUBLIC_PORT=3000
NEXT_PUBLIC_PROXY_HOST=http://localhost:3003
NEXT_PUBLIC_SITE_ID=AS
NEXT_PUBLIC_SUB_DOMAIN=http://localhost:3003
NEXT_PUBLIC_SERVER_API_URL=http://localhost:8000
SERVER_API_URL=http://localhost:8000
NEXT_PUBLIC_TINY_API_KEY=t9nc4z6inquvvd5pq1vea8wcp7lb01qmqseh6egms9vpaju2
NEXT_PUBLIC_ST_SERVICE_URL=https://apigateway.apps.rsonesoft.com
NEXT_PUBLIC_ST_REALGRID_KEY=upVcPE+wPOmtLjqyBIh9RkM/nBOseBrflwxYpzGZyYm9cY8amGDkiHqyYT2U1Yh3Dufv8SUhNy63kJZj9DH/cmSe3PbBoyaMZTR5mNBsNuyY63NNzIfzqxzwYuagP76LkxValpjT3ck=
# 401 시 브라우저 리다이렉트 대상
NEXT_PUBLIC_AUTH_LOGIN_REDIRECT_URL=/auth/login
# Sentry Configuration
NEXT_PUBLIC_SENTRY_DSN=http://f43f0aeff1cae8ea3f50a57f766ae37a@localhost:9001/2
NEXT_PUBLIC_SENTRY_ENVIRONMENT=local
SENTRY_ORG=sentry
SENTRY_PROJECT=as-frontend
SENTRY_AUTH_TOKEN=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
# OpenTelemetry Tracing Configuration
OTEL_SERVICE_NAME="as-frontend"
OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4320/v1/traces"
NEXT_PUBLIC_SENTRY_DEBUG=true