joindin/joindin-api — pull request #66 by richsage (2014-05-29 07:37:39+00:00)
Title: Add /users/me URI for logged-in users.

Includes a Frisby test.

There's been discussion previously about this both in IRC and also on [JIRA](https://joindin.jira.com/browse/JOINDIN-349). In doing some Android work, I still consider that it might be useful to have some sort of "default" user URI (for want of a better term), that is advertised in the docs.

The use case for me at the moment is down to the following workflow:

* Non-logged-in user sees a "My Events" tab on the Android app, alongside "Hot", "Upcoming" and "Past"
* Non-logged-in-user sees a message on this tab, prompting them to log in
* They proceed to the Settings area and log in via OAuth as normal, returning to the Settings area and seeing "You're logged in"
* They press Back on their device, taking them back to My Events
* The app doesn't know who they are, or subsequently their "attended" URI so can't list their events straight away. The user sees an empty tab.

Applying this patch would enable the app to immediately request `/users/me` upon a successful authentication, and get all the user details back (including their "attended" URI), rather than requesting an unrelated API route to find out the current user's URI. Then as the user clicks Back, the app can request details from the "attended" URI.