Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

feat(web): redirect authenticated users via deeplink when opening login from desktop app

Summary

When a user opens the login page from the desktop app but already has an active auth session in the browser, they are now redirected directly back to the app via deeplink instead of showing the login page.

The change adds a beforeLoad hook to the /auth route that:

  1. Checks for an existing Supabase session
  2. If authenticated and flow=desktop, redirects to /callback/auth with the session tokens (which then triggers the deeplink back to the app)
  3. If authenticated and flow=web, redirects to the specified redirect URL or /app/account

Review & Testing Checklist for Human

  • Test desktop flow: Open the login page from the desktop app when you're already logged in via browser - verify it redirects back to the app via deeplink without showing the login page
  • Test web flow: Verify existing web auth flow still works (visiting /auth when not logged in should show login page)
  • Test expired session edge case: If you have an expired session cookie, verify the behavior is correct (should either show login or handle gracefully)

Notes

  • This follows the same pattern used in _view/app/route.tsx for session checking
  • The tokens are passed via URL query params to the callback page, which is the existing pattern used in the OAuth callback flow

Link to Devin run: https://app.devin.ai/sessions/78993246b5074d7ab14b620fbb11fd71
Requested by: @ComputelessComputer

…in from desktop app

When a user opens the login page from the desktop app but already has an active auth session, redirect them directly back to the app via deeplink instead of showing the login page.

Co-Authored-By: [email protected] <[email protected]>
@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 hyprnote ready!

Name Link
🔨 Latest commit e39205c
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/6960b60a51179000083b351c
😎 Deploy Preview https://deploy-preview-2929--hyprnote.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Jan 9, 2026

Deploy Preview for hyprnote-storybook canceled.

Name Link
🔨 Latest commit e39205c
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/6960b60a98d6fd000835b784

@netlify
Copy link

netlify bot commented Jan 9, 2026

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

Name Link
🔨 Latest commit e39205c
🔍 Latest deploy log https://app.netlify.com/projects/howto-fix-macos-audio-selection/deploys/6960b60a1b78c60008a5674a

@ComputelessComputer ComputelessComputer merged commit a583eb4 into main Jan 10, 2026
19 of 20 checks passed
@ComputelessComputer ComputelessComputer deleted the devin/1767945692-auth-session-redirect 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.

2 participants