session = Services::session(); $this->setClientId(env('socket.google.client.id')); $this->setClientSecret(env('socket.google.client.key')); $this->setRedirectUri(base_url(env('socket.google.client.callback_url'))); $this->addScope('email'); $this->addScope('profile'); } public function setToken(string $access_code): void { // 토큰 정보 가져오기 $tokenInfo = $this->fetchAccessTokenWithAuthCode($access_code); if (isset($tokenInfo['error'])) { throw new ConfigException($tokenInfo['error']); } $tokenName = env('socket.google.client.token_name'); $token = $tokenInfo[$tokenName]; // Google Service에 접근하기 위해 Access Token 설정 $this->setAccessToken($token); // 세션에 Token 값 설정 $this->session->set($tokenName, $token); } public function getToken(): ?string { return $this->session->get(env('socket.google.client.token_name')); } }