Skip to content

chore: update currentURL - #78

Merged
Myxogastria0808 merged 10 commits into
mainfrom
dev
Jan 25, 2026
Merged

chore: update currentURL#78
Myxogastria0808 merged 10 commits into
mainfrom
dev

Conversation

@Myxogastria0808

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings January 25, 2026 11:03
@Myxogastria0808
Myxogastria0808 merged commit 5a4796c into main Jan 25, 2026
12 checks passed

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

Removes the dedicated VITE_REDIRECT_URL configuration and updates the frontend auth flow to preserve/restore the user’s current path via a safe redirect query parameter.

Changes:

  • Removed VITE_REDIRECT_URL from setup types/loader, generated .env files, examples, and GitHub Actions workflows.
  • Added safe redirect parsing + callback URL building utilities (getRedirectPath, buildCallbackURL).
  • Updated SessionCheck/Login/Header/SocialLink to use VITE_CLIENT_URL and the redirect query param for post-auth navigation.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
setup/src/types.ts Drops viteRedirectUrl from FrontendConfig.
setup/src/index.ts Stops writing VITE_REDIRECT_URL into the frontend .env.
setup/src/functions.ts Stops reading/printing/returning VITE_REDIRECT_URL from .env.
products/frontend/src/routes/Share/components/Header/index.tsx Removes auto-redirect-to-login on session error; shows login link when not authenticated.
products/frontend/src/routes/SessionCheck/index.tsx Adds redirect query propagation on auth failure and safe redirect after session success.
products/frontend/src/routes/Profile/components/SocialLink/index.tsx Uses VITE_CLIENT_URL for social link callback URL.
products/frontend/src/routes/Login/index.tsx Builds OAuth callback URL from VITE_CLIENT_URL plus safe redirect query param.
products/frontend/src/lib/redirect.ts Introduces safe redirect parsing and callback URL construction helpers.
products/frontend/.env.example Removes VITE_REDIRECT_URL from example env file.
.env.example Removes VITE_REDIRECT_URL from root example env file.
.github/workflows/preview-frontend.yaml Removes VITE_REDIRECT_URL from preview build env.
.github/workflows/deploy-frontend.yaml Removes VITE_REDIRECT_URL from deploy build env.

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

Comment on lines +46 to 50
) : (
<NavLink className={styles.navLink} to="/login">
ログイン
</NavLink>
)}

Copilot AI Jan 25, 2026

Copy link

Choose a reason for hiding this comment

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

The UI can briefly show the "ログイン" link even for authenticated users: isSuccess can become true before the async generateIdenteapot(...) finishes and sets identicon, so the ternary falls into the login branch until identicon is populated. Consider rendering the login link only when the session check is definitively unauthenticated (e.g., isError), and render nothing/placeholder while isPending or while isSuccess but identicon is still loading.

Suggested change
) : (
<NavLink className={styles.navLink} to="/login">
ログイン
</NavLink>
)}
) : sessionCheckMutation.isError ? (
<NavLink className={styles.navLink} to="/login">
ログイン
</NavLink>
) : null}

Copilot uses AI. Check for mistakes.
const Login: FC = () => {
// callbackURLを構築
// 1. 現在のURLを取得
// status: https://pay-crew2.yukiosada.work/login?redirect=/some/safe/path

Copilot AI Jan 25, 2026

Copy link

Choose a reason for hiding this comment

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

The inline example URL in this comment hard-codes a specific production domain (pay-crew2.yukiosada.work). This can become outdated/misleading for other environments; consider using a generic placeholder domain (e.g. https://example.com/...) or describing the shape of the URL without a concrete host.

Suggested change
// status: https://pay-crew2.yukiosada.work/login?redirect=/some/safe/path
// status: https://example.com/login?redirect=/some/safe/path

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