Moved to use X-Auth-Token header for auth and new url format for later use

This commit is contained in:
laf
2014-07-08 19:26:17 +01:00
parent 96c0457a75
commit 47c91b458e
4 changed files with 61 additions and 53 deletions

View File

@@ -15,7 +15,7 @@
function authToken(\Slim\Route $route)
{
$app = \Slim\Slim::getInstance();
$token = $route->getParam('key');
$token = $app->request->headers->get('X-Auth-Token');
if(isset($token) && !empty($token))
{
$username = dbFetchCell("SELECT `U`.`username` FROM `api_tokens` AS AT JOIN `users` AS U ON `AT`.`user_id`=`U`.`user_id` WHERE `AT`.`token_hash`=?", array($token));