npm / www

community space for the npm website
https://npm.community
69 stars 48 forks source link

'Edit Profile' link 404's when on /org/ route of a user #366

Open RoryDuncan opened 6 years ago

RoryDuncan commented 6 years ago

Link to the page

https://www.npmjs.com/org/roryduncan

Logged in or logged out?

Logged in.

Expected behavior

When clicking the Edit Profile 'button': the URL will change and load https://www.npmjs.com/settings/roryduncan/profile,

Actual behavior

When clicking the Edit Profile 'button': the URL changes to https://www.npmjs.com/org/settings/roryduncan/profile, which is a 404.

Steps to reproduce the problem

  1. Visit the url of a user that does not have a corresponding org (in my case https://www.npmjs.com/org/roryduncan)
  2. Click the Edit Profile button.
  3. Observe.

Browser with version

Chrome 65

Any error message?

404 status, otherwise no.

Notes

This seems to happen for user accounts that don't have an org account with the same name as the user. The route seems to show user accounts if an org doesn't exist, hence my URL has no org, and shows my NPM profile.

This could be because the anchor's href is settings/roryduncan/profile--Lacking a leading slash (/)--but I'm not familiar enough with all of NPM's routes to know if that's intended.