Skip to content

chore: update redirect url setting - #12

Merged
Myxogastria0808 merged 2 commits into
mainfrom
dev
Jan 3, 2026
Merged

chore: update redirect url setting#12
Myxogastria0808 merged 2 commits into
mainfrom
dev

Conversation

@Myxogastria0808

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings January 3, 2026 21:36
@Myxogastria0808
Myxogastria0808 merged commit 07576a3 into main Jan 3, 2026
12 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2fec398e48

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +9 to +11
ssl: {
rejectUnauthorized: false,
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid forcing SSL for all drizzle-kit connections

This config now enables SSL unconditionally. The local development Postgres in compose.yaml uses the stock postgres:latest image without SSL certs configured, which rejects SSL connections by default. As a result, drizzle-kit generate/migrate/studio will fail locally with a “server does not support SSL” error when using the standard DATABASE_URL. Consider gating ssl on an environment flag or encoding sslmode in DATABASE_URL so local dev remains usable.

Useful? React with 👍 / 👎.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for a configurable redirect URL (VITE_REDIRECT_URL) throughout the application stack, replacing a previously hardcoded callback URL for Discord OAuth authentication. Additionally, it enables SSL configuration for database connections and adds a production frontend URL to the backend's trusted origins.

Key changes:

  • Added VITE_REDIRECT_URL environment variable across setup scripts, frontend code, and CI/CD workflows
  • Replaced hardcoded callback URL 'http://localhost:5173/' with configurable environment variable
  • Enabled SSL configuration in Drizzle database config with certificate validation disabled
  • Added production URL 'https://pay-crew2.yukiosada.work' to backend trusted origins

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
setup/src/types.ts Added viteRedirectUrl field to FrontendConfig type definition
setup/src/functions.ts Added loading and configuration of VITE_REDIRECT_URL environment variable
setup/src/index.ts Added VITE_REDIRECT_URL to generated frontend .env file
products/frontend/src/routes/Root/index.tsx Fixed import path typo and replaced hardcoded callback URL with environment variable
products/frontend/.env.example Added VITE_REDIRECT_URL to example environment file
products/backend/src/auth.ts Added production URL to trustedOrigins array
products/backend/src/auth.cli.ts Added production URL to trustedOrigins array
products/backend/drizzle.config.ts Enabled SSL configuration with rejectUnauthorized set to false
.github/workflows/preview-frontend.yaml Added VITE_REDIRECT_URL secret to build environment
.github/workflows/deploy-frontend.yaml Added VITE_REDIRECT_URL secret to build environment

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

baseURL: env.BETTER_AUTH_URL,
// allow requests from the frontend development server
trustedOrigins: ['http://localhost:5173'],
trustedOrigins: ['https://pay-crew2.yukiosada.work', 'http://localhost:5173'],

Copilot AI Jan 3, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoding the production URL 'https://pay-crew2.yukiosada.work' in trustedOrigins reduces maintainability and makes the code less flexible across different environments (staging, preview, production). Consider extracting this to an environment variable or deriving it from the existing BETTER_AUTH_URL to make the configuration more maintainable and environment-agnostic.

Copilot uses AI. Check for mistakes.
baseURL: process.env.BETTER_AUTH_URL as string,
// allow requests from the frontend development server
trustedOrigins: ['http://localhost:5173'],
trustedOrigins: ['https://pay-crew2.yukiosada.work', 'http://localhost:5173'],

Copilot AI Jan 3, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoding the production URL 'https://pay-crew2.yukiosada.work' in trustedOrigins reduces maintainability and makes the code less flexible across different environments (staging, preview, production). Consider extracting this to an environment variable or deriving it from the existing BETTER_AUTH_URL to make the configuration more maintainable and environment-agnostic.

Copilot uses AI. Check for mistakes.
Comment on lines +9 to +11
ssl: {
rejectUnauthorized: false,
},

Copilot AI Jan 3, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting rejectUnauthorized: false disables SSL certificate validation, which creates a security vulnerability by allowing man-in-the-middle attacks. While this might be necessary for development or certain database providers, it should be avoided in production. Consider making this configurable via an environment variable so it can be set to true in production while allowing false for development environments where self-signed certificates might be used.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants