summaryrefslogtreecommitdiff
path: root/modules/rest/controllers/rest.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/rest/controllers/rest.php')
-rw-r--r--modules/rest/controllers/rest.php10
1 files changed, 1 insertions, 9 deletions
diff --git a/modules/rest/controllers/rest.php b/modules/rest/controllers/rest.php
index a6b618e8..9f0bc5b3 100644
--- a/modules/rest/controllers/rest.php
+++ b/modules/rest/controllers/rest.php
@@ -27,15 +27,7 @@ class Rest_Controller extends Controller {
throw new Rest_Exception("Forbidden", 403);
}
- $key = ORM::factory("user_access_token")
- ->where("user_id", "=", $user->id)
- ->find();
- if (!$key->loaded()) {
- $key->user_id = $user->id;
- $key->access_key = md5($user->name . rand());
- $key->save();
- }
-
+ $key = rest::get_access_token($user->id);
rest::reply($key->access_key);
}