Skip to content

Implement Reusable Authentication Gating System - #35

Merged
omharde42 merged 2 commits into
mainfrom
feat/authentication-gating-system-4006304126101425211
Sep 11, 2026
Merged

omharde42 merged 2 commits into
mainfrom
feat/authentication-gating-system-4006304126101425211

Conversation

@omharde42

Copy link
Copy Markdown
Owner

Implemented an authentication-gating system for GamerZ Hub.

Summary of changes:

  1. Reusable Frontend Protection:

    • Created <RequireAuth> component (web/src/components/auth/require-auth.tsx) with Zustand hydration safety to guard private routes.
    • Extended useAuth() hook (web/src/hooks/useAuth.ts) with requireAuth(actionFn, redirectPath) for inline feature gating on public pages.
    • Updated login & register pages (web/src/app/auth/login/page.tsx, web/src/app/auth/register/page.tsx) to validate and preserve redirect target paths safely (preventing open redirects).
    • Applied route protection to settings (web/src/app/settings/page.tsx).
  2. Backend Authorization Alignment:

    • Updated Express route definitions for posts (server/src/routes/post.routes.ts) and tournaments (server/src/routes/tournament.routes.ts) to use optionalAuth for public reading/listing while enforcing strict authenticate (HTTP 401) on data-modifying actions.
  3. Real-Time Security:

    • Verified Socket.IO handshake JWT authentication in server/src/socket/handlers.ts. All 25 socket authorization unit tests pass cleanly.

PR created automatically by Jules for task 4006304126101425211 started by @omharde42

Co-authored-by: omharde42 <193398705+omharde42@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI lite review requested due to automatic review settings September 6, 2026 14:13

This comment was marked as off-topic.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

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

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 55f928cc-6a9c-48d3-a32c-7914cc39f0db


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.

@omharde42
omharde42 requested a review from YASH544847 September 6, 2026 14:26
Repository owner deleted a comment from chatgpt-codex-connector Bot Sep 7, 2026
@omharde42
omharde42 merged commit 13a4e84 into main Sep 11, 2026
7 of 8 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.

2 participants