authService = $authService; } public function registerRoutes(\Szurubooru\Router $router) { $router->post('/api/login', [$this, 'login']); $router->get('/api/login', [$this, 'login']); } public function login() { $input = new \Szurubooru\Helpers\InputReader(); $this->authService->loginFromCredentials($input->userName, $input->password); return $this->authService->getLoginToken(); } }