Skip to content

feat(web): redirect authenticated users away from login page#2928

Closed
devin-ai-integration[bot] wants to merge 3 commits intomainfrom
devin/1767945457-auth-redirect-when-logged-in
Closed

feat(web): redirect authenticated users away from login page#2928
devin-ai-integration[bot] wants to merge 3 commits intomainfrom
devin/1767945457-auth-redirect-when-logged-in

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Jan 9, 2026

Summary

When a user with an active auth session visits the /auth (login) page with flow=web, they are now automatically redirected away from the login page. The redirect destination is either the redirect search param if provided, or /app/account by default.

This mirrors the inverse logic in /_view/app/route.tsx which redirects unauthenticated users TO /auth.

Desktop flow (flow=desktop) is intentionally unaffected to allow the desktop app OAuth handshake to complete.

Security

The redirect parameter is validated to prevent open redirect attacks. URLs starting with http://, https://, or // are rejected and fall back to /app/account.

Review & Testing Checklist for Human

  • Test web flow: Visit /auth?flow=web while logged in - should redirect to /app/account
  • Test redirect param: Visit /auth?flow=web&redirect=/pricing while logged in - should redirect to /pricing
  • Test open redirect protection: Visit /auth?flow=web&redirect=https://evil.com while logged in - should redirect to /app/account (NOT evil.com)
  • Test protocol-relative URL: Visit /auth?flow=web&redirect=//evil.com while logged in - should redirect to /app/account
  • Test desktop flow: Visit /auth?flow=desktop while logged in - should NOT redirect (allows OAuth to complete)
  • Test unauthenticated: Visit /auth while logged out - should show login page normally

Notes

Requested by @ComputelessComputer

Link to Devin run

@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@netlify
Copy link

netlify bot commented Jan 9, 2026

Deploy Preview for howto-fix-macos-audio-selection canceled.

Name Link
🔨 Latest commit 96cfd98
🔍 Latest deploy log https://app.netlify.com/projects/howto-fix-macos-audio-selection/deploys/6962022dd4b71d00084fccf7

@netlify
Copy link

netlify bot commented Jan 9, 2026

Deploy Preview for hyprnote failed.

Name Link
🔨 Latest commit 96cfd98
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/6962022c76228200081b48a8

@netlify
Copy link

netlify bot commented Jan 9, 2026

Deploy Preview for hyprnote-storybook canceled.

Name Link
🔨 Latest commit 96cfd98
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/6962022ced4b810007ba5f32

devin-ai-integration bot and others added 2 commits January 9, 2026 09:11
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
@ComputelessComputer ComputelessComputer requested review from yujonglee and removed request for ComputelessComputer January 10, 2026 07:42
@ComputelessComputer ComputelessComputer deleted the devin/1767945457-auth-redirect-when-logged-in branch January 10, 2026 08:02
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

Comments