session = Services::session(); $this->token_name = $token_name; } public function setToken(string $access_code): void { // 토큰 정보 가져오기 $tokenInfo = $this->fetchAccessTokenWithAuthCode($access_code); if (isset($tokenInfo['error'])) { throw new ConfigException($tokenInfo['error']); } $token = $tokenInfo[$this->token_name]; // Google Service에 접근하기 위해 Access Token 설정 $this->setAccessToken($token); // 세션에 Token 값 설정 $this->session->set($this->token_name, $token); } public function getToken(): ?string { return $this->session->get($this->token_name); } }