Closed frbl closed 8 years ago
How do we deal with incomplete tokens?
My suggestion, allow a person to have multiple tokens IF there is not yet a valid one.
I don't see why we should make an exception for incomplete tokens. Once a user has clicked on a service, we lock them into that service. So if they click "Google Fit", we create an incomplete google fit token. If they can cancel that process and at a later time try to resume it, we'll resuse that same incomplete token (and since they've already chosen for Google Fit, we don't allow them to switch to a different service). When the oauth registration completes successfully, the incomplete token is updated and becomes a complete token.
Fixed in #73.
In order to only allow the use of one token per participant, the following needs to change:
has_many
inPhysiqual::User
tohas_one
physiqual_user_id
in thephysiqual_tokens
tableFurthermore, we need to remove the code where the data from multiple tokens gets merged and where data is retrieved from multiple sensor provider services.