Return UserOptions with authenticate call

This commit is contained in:
kiswa 2016-07-22 20:13:06 +00:00
parent 76fa6e9623
commit f2aff6a960

View File

@ -173,10 +173,12 @@ class Auth extends BaseController {
} }
$user = new User($this->container, $payload->uid); $user = new User($this->container, $payload->uid);
$opts = new UserOptions($this->container, $user->user_option_id);
$this->apiJson->setSuccess(); $this->apiJson->setSuccess();
$this->apiJson->addData($jwt); $this->apiJson->addData($jwt);
$this->apiJson->addData($this->sanitizeUser($user)); $this->apiJson->addData($this->sanitizeUser($user));
$this->apiJson->addData($opts);
return $this->jsonResponse($response); return $this->jsonResponse($response);
} }
@ -203,7 +205,7 @@ class Auth extends BaseController {
// If 'remember me' feature is desired, set the multiplier higher // If 'remember me' feature is desired, set the multiplier higher
return JWT::encode(array( return JWT::encode(array(
'exp' => time() + (60 * 30) * $mult, // 30 minutes * $mult 'exp' => time() + (60 * 30) * $mult, // 30 minutes * $mult
'uid' => $userId, 'uid' => (int) $userId,
'mul' => $mult 'mul' => $mult
), Auth::getJwtKey()); ), Auth::getJwtKey());
} }