forked from GNUsocial/gnu-social
Fix nonce usage in OAuth store
The OAuth store was failing on getting a request token, because the token value was forced to be non-null in the DB. Let this value be null, and use the correct primary key (consumer, timestamp, nonce). Drop the reference to token table, and don't ever use it.
This commit is contained in:
@@ -58,12 +58,11 @@ class LaconicaOAuthDataStore extends OAuthDataStore
|
||||
{
|
||||
$n = new Nonce();
|
||||
$n->consumer_key = $consumer->key;
|
||||
$n->tok = $token->key;
|
||||
$n->ts = $timestamp;
|
||||
$n->nonce = $nonce;
|
||||
if ($n->find(true)) {
|
||||
return true;
|
||||
} else {
|
||||
$n->ts = $timestamp;
|
||||
$n->created = DB_DataObject_Cast::dateTime();
|
||||
$n->insert();
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user