Use api user id instead of the provider's id for a user when saving oauth tokens

This commit is contained in:
Everett Sochowski 2014-02-20 14:09:24 +01:00
parent ac5e218c61
commit c924cf5be5

View File

@ -88,7 +88,10 @@ object OAuthAuthorisation {
//link the token with the concrete API User
obpUser.user.obj.map{
u => {
appToken.userId(u.id_)
//Note: ApiUser.id is the database id from ApiUser, as opposed to ApiUser.id_, which returns the id assigned
//to this user by its provider (i.e. not this api). We want ApiUser.id because it is unique, unlike the id given by a provider
// i.e. two different providers can have a user with id "bob"
appToken.userId(u.id.get.toString)
}
}
if (appToken.save())