Trial subscription request redirects to localhost:3000 instead of onedev.io #2857
roy opened 2 weeks ago

When requesting a trial subscription from a self-hosted instance, the browser is redirected to a URL on localhost:3000, which fails with ERR_CONNECTION_REFUSED.

Steps to reproduce:

  1. Run OneDev 16.0.8 (Docker image 1dev/server) at http://localhost:6610
  2. Go to Administration → Subscription Management
  3. Click "Request Trial Subscription" and complete the request
  4. Browser ends up at: https://localhost:3000/trial-subscription-key-generated/ → ERR_CONNECTION_REFUSED

Expected: redirect to the key page on onedev.io (looks like a dev-environment base URL leaked into the production redirect).

likely affects all versions since the redirect happens on onedev.io side

Note: the trial key is generated successfully — I recovered it by URL-decoding the path segment from the failed redirect URL and installing it via "Install Subscription Key", which activated the trial normally. So the impact is that new users likely think the trial request failed.

  • Robin Shen changed fields 2 weeks ago
    Name Previous Value Current Value
    Assignee
    robin
    wh
  • Work Horse commented 2 weeks ago

    Root cause is on the onedev.io website (onedev/website), not in the OneDev server package.

    The "Request Trial Subscription" form POSTs to https://onedev.io/subscription-key. That route redirected with request.nextUrl.origin, which behind nginx is the upstream host (https://localhost:3000), so the browser landed on https://localhost:3000/trial-subscription-key-generated/... and failed with ERR_CONNECTION_REFUSED. The trial key itself was generated correctly.

    Fixed by using getRequestOrigin() (canonical public site URL from AUTH_URL / NEXT_PUBLIC_SITE_URL) for those redirects, matching the signup flow. Also applied the same fix to the support-request redirect path, which had the same pattern.

    Website fix: https://code.onedev.io/onedev/website/~pulls/1

  • Robin Shen commented 2 weeks ago

    Thank you. Fixed in website.

  • Robin Shen changed state to 'Closed' 2 weeks ago
    Previous Value Current Value
    Open
    Closed
1/1
Type
Bug
Priority
Normal
Assignee
Affected Versions
16.0.8
Labels
No labels
Issue Votes (0)
Watchers (3)
Reference
OD-2857
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover