Esri/geotrigger-js — pull request #32 by patrickarlt (2013-12-31 21:52:15+00:00)
Title: dont set refresh token unless deviceToken exists

@ngoldman @kenichi this should fix https://github.com/Esri/geofaker-js/issues/28.

`session.refreshToken` was getting set to `undefined` when a token was refreshed. So this was what was happening in Geofaker

1. Session started with `clientId` and `refreshToken`
2. token requested
3. `session.token` gets set, `session.refreshToken` get set to undefined
4. hours pass
5. another request get made with an invalid `token`
6. use `clientId` and `refreshToken` (which is now undefined) to get a new access token...
7. which means a new device gets registered since `refreshToken` is falsey