"}) */ public function postLogin(Request $request) { $credentials = $request->only('email', 'password'); try { $token = JWTAuth::attempt($credentials, [ 'permissions' => [ 'view_users' => true, 'edit_users' => true, 'delete_users' => false, ] ]); if (!$token) { throw new UnauthorizedHttpException(''); } } catch (JWTException $ex) { throw new ServiceUnavailableHttpException(''); } return compact('token'); } /** * Check if Authenticated * * @Post("/validate") * @Versions({"v1"}) * @Request(headers={"Authorization": "Bearer "}) * @Response(204); */ public function postValidate(Request $request) { return $this->response->noContent(); } }