Skip to content

fix(auth): redirect authenticated users to /me instead of /admin - #323

Merged
trtajim merged 1 commit into
mainfrom
fix/auth-redirect-to-me
Sep 6, 2026
Merged

fix(auth): redirect authenticated users to /me instead of /admin#323
trtajim merged 1 commit into
mainfrom
fix/auth-redirect-to-me

Conversation

@trtajim

@trtajim trtajim commented Sep 6, 2026

Copy link
Copy Markdown
Member

Summary

  • Updated AuthController::index and AuthController::redirectToGoogle to redirect already-authenticated users to /me (route('me')) instead of /admin (route('admin.index')).
  • Added feature tests covering authenticated redirects for /login and /auth/google.

Summary by CodeRabbit

  • Bug Fixes

    • Authenticated users who visit the login page are now redirected to their account page instead of the admin dashboard.
    • Authenticated users who start Google sign-in are also redirected to their account page.
    • Guests can continue accessing the login page and Google sign-in flow as before.
  • Tests

    • Added coverage to verify the updated redirects for authenticated users and preserve guest authentication behavior.

@trtajim
trtajim merged commit d3d47ee into main Sep 6, 2026
5 of 6 checks passed
@trtajim
trtajim deleted the fix/auth-redirect-to-me branch September 6, 2026 13:50
@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: bc73ba80-3051-42a5-a553-e06954ee8190

📥 Commits

Reviewing files that changed from the base of the PR and between cd4dd94 and 5d4fb0b.

📒 Files selected for processing (2)
  • app/Http/Controllers/AuthController.php
  • tests/Feature/AuthenticationTest.php

📝 Walkthrough

Walkthrough

Authenticated users who access the login page or Google OAuth entry point are redirected to me instead of admin.index. Authentication tests add authenticated redirect coverage and clarify guest test names.

Changes

Authentication routing

Layer / File(s) Summary
Authenticated redirect behavior
app/Http/Controllers/AuthController.php, tests/Feature/AuthenticationTest.php
index() and redirectToGoogle() redirect authenticated users to me. Feature tests cover authenticated redirects and preserve guest behavior checks with clearer names.

Estimated code review effort: 1 (Trivial) | ~5 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/auth-redirect-to-me

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.

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