summaryrefslogtreecommitdiff
path: root/lib/apioauthstore.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/apioauthstore.php')
-rw-r--r--lib/apioauthstore.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/apioauthstore.php b/lib/apioauthstore.php
index 620f0947f..4d141286b 100644
--- a/lib/apioauthstore.php
+++ b/lib/apioauthstore.php
@@ -202,6 +202,14 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
$t->type = 0; // request
$t->state = 0; // unauthorized
$t->verified_callback = $callback;
+
+ if ($callback === 'oob') {
+ // six digit pin
+ $t->verifier = mt_rand(0, 999999);
+ } else {
+ $t->verifier = common_good_rand(8);
+ }
+
$t->created = DB_DataObject_Cast::dateTime();
if (!$t->insert()) {
return null;