Skip to content

feat: open explorer via deep link after social login#374

Open
LautaroPetaccio wants to merge 1 commit into
mainfrom
feat/explorer-deep-link
Open

feat: open explorer via deep link after social login#374
LautaroPetaccio wants to merge 1 commit into
mainfrom
feat/explorer-deep-link

Conversation

@LautaroPetaccio

Copy link
Copy Markdown
Collaborator

Summary

When a user logs in via an OAuth provider (Google, Discord, etc.) and returns to /auth/callback, they currently get redirected to the redirectTo URL. When no explicit redirect destination is set and the OPEN_EXPLORER_AFTER_LOGIN feature flag (dapps-open-explorer-after-login) is enabled, the callback now navigates to a new /auth/open-explorer page that posts the identity to the auth server and opens the explorer via a deep link.

How it works

CallbackPage changes

After successful login in handleContinue, checks whether OPEN_EXPLORER_AFTER_LOGIN is enabled and no explicit redirectTo path was provided (pathname is /). If both conditions hold, marks the user as returning and navigates to /open-explorer with history replace. Otherwise, the existing redirect flow proceeds unchanged.

OpenExplorerPage (new, self-contained)

  1. Reads account from ConnectionProvider context (persists across navigation)
  2. Gets the identity from localStorageGetIdentity(account)
  3. Posts it to the auth server via postIdentity endpoint
  4. Constructs a deep link: decentraland://?dclenv={env}&signin={identityId} where env is zone/today/org for dev/stg/prod
  5. Shows a 3-second countdown, then attempts to launch the deep link
  6. On deep link failure: shows "Try again" (retries with fresh countdown) and "Go back to login" buttons
  7. On postIdentity failure or missing account/identity: shows error with "Go back to login"

Feature flag

OPEN_EXPLORER_AFTER_LOGIN (dapps-open-explorer-after-login) — when disabled (default), behavior is completely unchanged.

Test plan

  • With flag enabled + no redirectTo: complete OAuth login → callback navigates to /open-explorer → shows countdown → launches deep link
  • With flag enabled + redirectTo=/marketplace: callback redirects to /marketplace as usual
  • With flag disabled: callback redirects as before (no behavior change)
  • Deep link fails: shows "Try again" + "Go back to login" buttons
  • "Try again" restarts the countdown and re-attempts the deep link
  • "Go back to login" navigates to /login
  • No account in context: redirects to /login

When OPEN_EXPLORER_AFTER_LOGIN feature flag is enabled and no explicit
redirectTo URL is set, navigate to /open-explorer after OAuth callback.
The new page posts the identity to the auth server, runs a countdown,
and launches a decentraland:// deep link to open the explorer app.
@vercel

vercel Bot commented Apr 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
auth Ready Ready Preview, Comment Apr 10, 2026 2:15pm

Request Review

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