Skip to content

feat: add redirectIfNotAuthenticatedMiddleware to enforce authentication before accessing app routes#1674

Open
paustint wants to merge 1 commit intomainfrom
fix/protected-assets-session-check
Open

feat: add redirectIfNotAuthenticatedMiddleware to enforce authentication before accessing app routes#1674
paustint wants to merge 1 commit intomainfrom
fix/protected-assets-session-check

Conversation

@paustint
Copy link
Copy Markdown
Contributor

We were previously relying on API calls to redirect the user on app load, but if the user does not have a session then there is no reason to server the application

Copilot AI review requested due to automatic review settings April 16, 2026 23:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an authentication gate for the SPA entry route so unauthenticated users are redirected to login instead of being served the /app shell.

Changes:

  • Introduces redirectIfNotAuthenticatedMiddleware to redirect missing/placeholder sessions to /auth/login.
  • Wires the new middleware into the /app middleware chain in the API server.

Reviewed changes

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

File Description
apps/api/src/main.ts Adds the new middleware into the /app route middleware stack.
apps/api/src/app/routes/route.middleware.ts Implements redirectIfNotAuthenticatedMiddleware for session-based gating.

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

Comment thread apps/api/src/app/routes/route.middleware.ts
Comment thread apps/api/src/main.ts Outdated
…ion before accessing app routes

We were previously relying on API calls to redirect the user on app load,
but if the user does not have a session then there is no reason to server the application
@paustint paustint force-pushed the fix/protected-assets-session-check branch from 6734aff to e6db530 Compare April 17, 2026 19:31
@paustint paustint requested a review from Copilot April 17, 2026 20:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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


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

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