Skip to content

feat: fix issue #4 - #137

Open
mahakagarwal7 wants to merge 1 commit into
hardikxk:masterfrom
mahakagarwal7:fix/frontend-auth-integration
Open

feat: fix issue #4#137
mahakagarwal7 wants to merge 1 commit into
hardikxk:masterfrom
mahakagarwal7:fix/frontend-auth-integration

Conversation

@mahakagarwal7

Copy link
Copy Markdown

This PR resolves Issue #4 by delivering a cohesive, single-page application (SPA) experience across the proxy (Gateway) and the Auth server. It fixes the broken frontend integration and implements a polished, aesthetic Login Page GUI.

What was changed:

1)Auth Page GUI Redesign (login.html & LoginController.java)

Problem: The auth page used the default Spring Security UI, which did not align with the overall application aesthetics.
Solution: Added Thymeleaf to the Auth service and implemented a custom login.html. The new GUI matches the LeetCode-inspired dark mode palette (glassmorphism, #1a1a1a backgrounds, and #ffa116 accents) to provide a premium, unified user experience.

2)SPA Proxy Integration (FrontendProxyController.java & GatewayApplication.java)

Problem: The Gateway proxy was previously dropping requests to the frontend SPA's static assets (CSS/JS chunks), resulting in a blank white screen.
Solution: Configured the Gateway to properly proxy all necessary HTTP methods and asset paths (/_astro/**, /*.svg, etc.) to the Astro frontend. The SPA now loads flawlessly through the proxy.

3)Seamless Login Redirection (LoginRedirectController.java & SecurityConfig.java)

Problem: The Gateway was intercepting login requests and displaying an unnecessary intermediate "Login with OAuth 2.0" selection screen.
Solution: Updated the Gateway's SecurityConfig to skip the default OAuth2 selection page. The new LoginRedirectController intercepts /login and seamlessly forwards users directly to the newly designed Auth page GUI, creating a smooth, SPA-like transition.

Why this doesn't break the original codebase?
Zero impact on core backend services: The problems-service and batch-service logic remains completely unchanged.
Secure by design: All OAuth2 standards and security chains remain intact. We merely styled the authentication endpoints and bypassed a redundant selection screen.
Non-disruptive proxying: The Gateway continues to securely guard backend API endpoints (/problems/, /code/) while accurately serving the frontend SPA files.

@mahakagarwal7 mahakagarwal7 changed the title feat: fix frontend integration and enhance auth UI feat: fix issue #4 May 31, 2026
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.

1 participant