Skip to content

Authenticate routes.#31

Merged
AndrewN4675 merged 5 commits intomainfrom
guard-authenticated-routes
Nov 18, 2025
Merged

Authenticate routes.#31
AndrewN4675 merged 5 commits intomainfrom
guard-authenticated-routes

Conversation

@jakevanhalder
Copy link
Copy Markdown
Collaborator

@jakevanhalder jakevanhalder commented Nov 17, 2025

This pull request guards routes with authentication and closes issue #20.

Key Changes:

Frontend file moves/renames

  • Multiple files relocated into the frontend/ directory (UI components, assets, configs, etc.).
  • These were renames only, with no functional code changes.

@jakevanhalder jakevanhalder linked an issue Nov 17, 2025 that may be closed by this pull request
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Nov 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
firstfm Error Error Nov 18, 2025 5:00am

Copy link
Copy Markdown

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

This PR implements authentication guards for protected routes and adds a logout flow. The changes include server-side session management via a new Django logout endpoint, client-side middleware for route protection, and improved Last.fm callback handling with better async/await patterns.

  • Route protection middleware that redirects unauthenticated users from /music-map to /login
  • Server and client-side logout functionality with proper state cleanup
  • Improved async/await error handling in the Last.fm callback flow

Reviewed Changes

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

Show a summary per file
File Description
backend/musicRecommendationService/views.py Added logout_view endpoint to clear Django session
backend/musicRecommendationService/urls.py Registered new /logout/ route
frontend/src/middleware.ts New middleware protecting /music-map and redirecting based on auth state
frontend/src/lib/components/Navbar.tsx Updated signOut to call backend logout and clear client state
frontend/src/app/services/lastfm_user.ts Added logoutUser function calling backend endpoint
frontend/src/app/login/lastfm-callback/page.tsx Refactored to async/await with improved error handling
frontend/src/lib/stores/auth-store.ts Zustand store for authentication state with localStorage persistence
frontend/src/lib/providers/auth-store-provider.tsx React context provider for auth store
.github/workflows/build-check.yml Updated to run build from frontend/ directory
Comments suppressed due to low confidence (1)

backend/musicRecommendationService/views.py:15

  • Import of 'get_session' is not used.
from .lastfm_stuff import get_session

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

Comment thread backend/musicRecommendationService/views.py
Comment thread backend/musicRecommendationService/views.py Outdated
Copy link
Copy Markdown
Owner

@AndrewN4675 AndrewN4675 left a comment

Choose a reason for hiding this comment

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

Looks great and Next.js built, just a Vercel error with finding the folder. Will fix it

@AndrewN4675 AndrewN4675 merged commit 86f80d6 into main Nov 18, 2025
2 of 3 checks passed
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.

Authenticate Routes

3 participants