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:
Evan Prodromou
2009-03-07 12:55:09 -08:00
parent 22742c3b72
commit 1179ecd13d
4 changed files with 9 additions and 12 deletions

View File

@@ -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;