mozilla-services / location-leaderboard

A leaderboard service for Mozilla Geolocation Stumbling
Mozilla Public License 2.0
4 stars 5 forks source link

Change update name to pull display name from FXA #234

Closed jaredlockhart closed 8 years ago

jaredlockhart commented 8 years ago

Presently, we have an API end point for updating a users display name in the leaderboard. However the client will not set the display name directly on the leaderboard, it will instead set the display name in FXA and the server will have to retrieve the display name from FXA and set it locally. To do this requires that the client pass its access token into the server, and so that request will need to be triggered by the client after it sets its display name with FXA. Change the update name endpoint to receive only an access token, request the profile information from FXA, and store the display name on the contributor object.

jaredlockhart commented 8 years ago

Instead of doing it asynchronously or using an explicit API endpoint, we will query this information and store it at authentication time since we 1) already make the outgoing profile call and 2) query the contributor row from the database during the authentication step, it's a very small change to compare and store the display name at this time. Then we move the update contributor API endpoint altogether.