Skip to content

Extract Nuxt SDK API route paths into shared constants - #88

Merged
brionmario merged 1 commit into
thunder-id:mainfrom
janithjay:fix/nuxt-api-route-constants
Aug 20, 2026
Merged

Extract Nuxt SDK API route paths into shared constants#88
brionmario merged 1 commit into
thunder-id:mainfrom
janithjay:fix/nuxt-api-route-constants

Conversation

@janithjay

Copy link
Copy Markdown
Contributor

Purpose

Nuxt SDK runtime modules repeated /api/auth/* route string literals across module.ts, composables, plugins, middleware, and the SSR Nitro plugin. This risked routes drifting out of sync if one call site was updated without the others.

Approach

  • Added packages/nuxt/src/runtime/constants/NuxtAPIRoutes.ts as the single source of truth for all /api/auth/* paths (SIGN_IN, SIGN_UP, SIGN_OUT, CALLBACK, SESSION, TOKEN, META, USER, USER_PROFILE), following the same typed-constants-object pattern already used elsewhere in the monorepo (e.g. VendorConstants).

  • Replaced every route string literal with NuxtAPIRoutes.*:

    • module.ts - Nitro server handler registration
    • runtime/components/ThunderIDRoot.ts - profile fetch/update, flow metadata fetch
    • runtime/composables/useThunderID.ts - sign-in/sign-up/sign-out
    • runtime/plugins/thunderid.ts - sign-in/sign-up/sign-out, access token
    • runtime/middleware/defineThunderIDMiddleware.ts - default redirect path
    • runtime/server/plugins/thunderid-ssr.ts - OAuth callback URL
  • Request methods and route behavior are unchanged - this is a pure literal-to-constant extraction.

Related Issues

Related PRs

  • N/A

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
  • Tests provided. (Add links if there are any)
    • Unit Tests
    • Integration Tests
  • Breaking changes. (Fill if applicable)
    • Breaking changes section filled.
    • breaking change label added.

Security checks

  • Followed secure coding standards.
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

Copilot AI lite review requested due to automatic review settings August 20, 2026 09:16

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4a1f66c0-3471-42e1-9747-058e71d284d9


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Signed-off-by: janithjay <janithjayashan018@gmail.com>
@janithjay
janithjay force-pushed the fix/nuxt-api-route-constants branch from c4c0de7 to 482feb4 Compare August 20, 2026 09:17
@brionmario
brionmario merged commit 75ac08b into thunder-id:main Aug 20, 2026
6 checks passed
@janithjay
janithjay deleted the fix/nuxt-api-route-constants branch August 20, 2026 09:26
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.

Extract Nuxt SDK API route paths into shared constants

3 participants