Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlorchard@mozilla.com <lorchard@mozilla.com@4eb1ac78-321c-0410-a911-ec516a8615a5>2009-06-10 15:24:27 (GMT)
committer lorchard@mozilla.com <lorchard@mozilla.com@4eb1ac78-321c-0410-a911-ec516a8615a5>2009-06-10 15:24:27 (GMT)
commit662ee0eb264ace26db784fb785f08e473eb16fc9 (patch)
treee36df9056081a67bd8763d8fd3c80ed5e1f7d5dd
parent6c4d4c07d293fc5322e1ada67dcae5b61159c274 (diff)
bug 496612: now reporting an error if auth token generation failed
git-svn-id: http://svn.mozilla.org/addons/trunk@27461 4eb1ac78-321c-0410-a911-ec516a8615a5
-rw-r--r--site/app/controllers/sharing_api_controller.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/site/app/controllers/sharing_api_controller.php b/site/app/controllers/sharing_api_controller.php
index 0f7713d..3c68263 100644
--- a/site/app/controllers/sharing_api_controller.php
+++ b/site/app/controllers/sharing_api_controller.php
@@ -823,7 +823,13 @@ class SharingApiController extends AppController
)
);
$this->Amo->clean($data);
- $this->ApiAuthToken->save($data);
+
+ if (!$this->ApiAuthToken->save($data)) {
+ return $this->renderStatus(
+ self::STATUS_ERROR, 'error',
+ array('reason' => 'auth_token_generation_failed')
+ );
+ }
$new_token = $this->ApiAuthToken->findById($this->ApiAuthToken->id);
$token_value = $new_token['ApiAuthToken']['token'];