near / near-discovery

The homebase for Near Builders
https://dev.near.org
The Unlicense
49 stars 71 forks source link

DevHub Links on near.org are broken, go to about:blank #897

Closed elliotBraem closed 10 months ago

elliotBraem commented 10 months ago

Describe the bug

All of the links on DevHub such as in the navigation bar are redirecting to about:blank rather than the correct route. This is related to #894

NOTICE: This only occurs on near.org and is not an issue on near.social.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://near.org/devhub.near/widget/app
  2. Click on "/communities" in the navbar
  3. Notice redirect to about:blank

More Context

This must be related to the recent reported security vulnerability where we need to check that href is typeof string before linking.

Near.social fixed it with this solution: https://github.com/NearSocial/viewer/blob/91e1739d6ebb39e6cbbb35198608412a6695fc9c/src/App.js#L80C3-L80C3

Near.org solution is more intense: https://github.com/near/near-discovery/commit/d107f816e2d96d2e3d471f308b3ed228c08da165

We are creating valid links such as : to="/devhub.near/widget/app?page=communities", these pass near.social but fail on near.org

elliotBraem commented 10 months ago

Any thoughts on this? @charleslavon tagging you because you completed the PR #894

Is there a reason/motivation behind the difference between near.social and near.org solution?

charleslavon commented 10 months ago

@elliotBraem I implemented our differently initially to pacify typescript, and unintentionally created this regression. It's fixed now. Thanks for reporting