[wp-trac] [WordPress Trac] #38521: REST API: Get rid of the `/users/me` redirect

WordPress Trac noreply at wordpress.org
Mon Oct 31 04:33:04 UTC 2016


#38521: REST API: Get rid of the `/users/me` redirect
--------------------------+--------------------------
 Reporter:  jnylen0       |       Owner:  rachelbaker
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  4.7
Component:  REST API      |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  close         |     Focuses:
--------------------------+--------------------------

Comment (by pento):

 Replying to [comment:15 rmccue]:
 > Let me be clear: if OAuth libraries don't follow redirects correctly,
 '''they are broken'''. Similar arguments could be made for the various
 HTTP request methods, headers we send back, etc etc: the client may see
 "this doesn't work", but it's not always our job to fix this. If the OAuth
 libraries don't work properly, that is an issue with them.

 Agreed, OAuth libraries that don't support redirects are probably broken
 in other ways.

 Recommending `fetch()` isn't a viable workaround for `XMLHttpRequest`
 behaviour, though. [http://caniuse.com/#feat=fetch Browser support is at
 61%], which is way too low for us to recommend.

 > The thing is that `/users/me` is '''not''' a resource. We cannot just
 pretend it is. There's no entry in the database with the ID `me`. It is a
 pointer to a real resource with a real ID.

 The only argument against this is that `/users/me` isn't a "real"
 resource? It's pretty common for APIs to provide an API for the current
 user - Facebook has `/me`, GitHub has `/user`, Twitter has `/account`,
 Google+ has `/people/me`, Spotify has `/me`, Shopify has `/users/current`.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38521#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list