diff options
Diffstat (limited to 'src/controllers/UserTokenController.php')
-rw-r--r-- | src/controllers/UserTokenController.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/controllers/UserTokenController.php b/src/controllers/UserTokenController.php index 20bd06c..fe0d37d 100644 --- a/src/controllers/UserTokenController.php +++ b/src/controllers/UserTokenController.php @@ -16,22 +16,22 @@ class UserTokenController extends BaseController { /** * Only the tokens of the authenticated user are shown */ - public function index() { - return $this->userToken->where('userId', '=', Auth::user()->id)->get(); + public function index($userEmail = null) { + return $this->userToken->where('userEmail', Auth::user()->email)->get(); } /** * Only the tokens of the authenticated user are available */ - public function show($id) { - return $this->userToken->where('userId', '=', Auth::user()->id)->findOrFail($id); + public function show($userEmail, $id) { + return $this->userToken->where('userEmail', Auth::user()->email)->findOrFail($id); } /** - * Set the userId and create a random token + * Set the userEmail and create a random token */ public function store() { - $this->userToken->userId = Auth::user()->id; + $this->userToken->userEmail = Auth::user()->email; $this->userToken->token = base64_encode(openssl_random_pseudo_bytes(64)); if ($this->userToken->save()) { |