You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On mobile (Samsung), the device Back button "simply takes you to the sign-in screen" — a dead end for a logged-in user.
Root cause
Sign-in is a full-page OAuth redirect (signInWithOAuth → Google → /auth/callback → app), so /auth/signin stays on the browser history stack. Pressing Back pops to it. The sign-in page had no auth guard, so it just rendered the sign-in form again even though the user is already authenticated.
Fix
Guard the sign-in server component: if a session already exists (loadConsoleProfile() — the app's existing auth gate), redirect() into the app instead of rendering the form. So Back → /auth/signin → immediate forward-redirect to the console, which is the behavior a user expects.
Honours a safe app-internal ?next (only /-prefixed, non-// targets) else /dashboard — no open-redirect surface.
export const dynamic = 'force-dynamic' so the guard runs per request.
Redirects already-signed-in users away from /auth/signin so the mobile Back button doesn’t trap them on the sign-in screen after OAuth. Addresses Linear #51.
Bug Fixes
Added server-side guard on /auth/signin: if loadConsoleProfile() finds a session, call redirect() to ?next or /dashboard.
Validates ?next as app-internal (starts with /, not //) to prevent open redirects.
Sets export const dynamic = 'force-dynamic' to run the guard on every request.
Written for commit c3aeba6. Summary will update on new commits.
On mobile the device Back button pops history to /auth/signin — the
OAuth sign-in flow leaves that route on the stack — so an authenticated
user pressing Back dead-ended on the sign-in screen. Guard the sign-in
page: if a session already exists, redirect into the app (honouring a
safe app-internal ?next, else /dashboard), so Back effectively returns to
the console instead. Open-redirect-safe: only '/'-prefixed, non-'//'
targets are honoured.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ByQJWuMebsKpQcHNqXCBWD
This pull request has been ignored for the connected project adnmbikaqnxivalqoild because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.
@TechHypeXP, you've reached your PR review limit, so we couldn't start this review.
Next review available in:12 minutes
Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).
How can I continue?
After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.
To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.
How do review limits work?
CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.
For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.
We reviewed changes in e4aedac...c3aeba6 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer TIP This summary will be updated as you push new changes.
…121)
On mobile the device Back button pops history to /auth/signin — the
OAuth sign-in flow leaves that route on the stack — so an authenticated
user pressing Back dead-ended on the sign-in screen. Guard the sign-in
page: if a session already exists, redirect into the app (honouring a
safe app-internal ?next, else /dashboard), so Back effectively returns to
the console instead. Open-redirect-safe: only '/'-prefixed, non-'//'
targets are honoured.
Claude-Session: https://claude.ai/code/session_01ByQJWuMebsKpQcHNqXCBWD
Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem (from live mobile testing)
On mobile (Samsung), the device Back button "simply takes you to the sign-in screen" — a dead end for a logged-in user.
Root cause
Sign-in is a full-page OAuth redirect (
signInWithOAuth→ Google →/auth/callback→ app), so/auth/signinstays on the browser history stack. Pressing Back pops to it. The sign-in page had no auth guard, so it just rendered the sign-in form again even though the user is already authenticated.Fix
Guard the sign-in server component: if a session already exists (
loadConsoleProfile()— the app's existing auth gate),redirect()into the app instead of rendering the form. So Back →/auth/signin→ immediate forward-redirect to the console, which is the behavior a user expects.?next(only/-prefixed, non-//targets) else/dashboard— no open-redirect surface.export const dynamic = 'force-dynamic'so the guard runs per request.Covers task #51.
Verification
tsc --noEmit: clean🤖 Generated with Claude Code
Generated by Claude Code
Summary by cubic
Redirects already-signed-in users away from
/auth/signinso the mobile Back button doesn’t trap them on the sign-in screen after OAuth. Addresses Linear #51./auth/signin: ifloadConsoleProfile()finds a session, callredirect()to?nextor/dashboard.?nextas app-internal (starts with/, not//) to prevent open redirects.export const dynamic = 'force-dynamic'to run the guard on every request.Written for commit c3aeba6. Summary will update on new commits.