summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-03-07 12:55:09 -0800
committerEvan Prodromou <evan@controlyourself.ca>2009-03-07 12:55:09 -0800
commit1179ecd13d68e76d74ad94e2d3ca22d9681eeffe (patch)
treee0517dbd0df004f531adfa6f411c2087b5bd0190 /lib
parent22742c3b72a02c29eef0e678abd839e378a783c4 (diff)
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/oauthstore.php3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/oauthstore.php b/lib/oauthstore.php
index 9af05ea2d..7d2e1f27b 100644
--- a/lib/oauthstore.php
+++ b/lib/oauthstore.php
@@ -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;