The query in function
oauth_common_get_user_provider_tokens($uid) {
$res = db_query("SELECT t.*, pt.created, pt.changed, pt.services, pt.authorized FROM {oauth_common_token} t
INNER JOIN {oauth_common_provider_token} pt WHERE t.uid = :uid AND t.type = :type", array(
':uid' => $uid,
':type' => OAUTH_COMMON_TOKEN_TYPE_ACCESS,
));
$tokens = array();
while ($token = DrupalOAuthToken::fromResult($res)) {
$tokens[] = $token;
}
return $tokens;
}
but from the comments in the table oauth_common_provider_token I would expect them be joined on 'tid', the key field in oauth_common_token but there is no join field specified.
Changing the join to INNER JOIN {oauth_common_provider_token} pt USING(tid) fixes the authorization list for users (user/%uid/oauth). Without the change each token is listed twice.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | oauth-oauth_common_get_user_provider_tokens-1431882-4-D6.patch | 693 bytes | christianchristensen |
Comments
Comment #1
jobeirne commentedAwesome; thanks for the report. I've tested this and will be committing it.
Comment #2
jobeirne commentedFixed in this commit. Thanks again, nevets.
Comment #3
jobeirne commentedComment #4
christianchristensen commentedHere's a 6.x patch (particularly for those who might need to patch in the mean time ;).