private function processAuthDone($providerId) { $adapterFactory = new AdapterFactory($this->config, $this->storage); $adapter = $adapterFactory->setup($providerId); if (!$adapter) { $adapter->setUserUnconnected(); Util::error404('Invalid parameter! Please return to the login page and try again.'); } try { $adapter->loginFinish(); } catch (\Exception $e) { $this->storage->set('error.status', 1); $this->storage->set('error.message', $e->getMessage()); $this->storage->set('error.code', $e->getCode()); $this->storage->set('error.exception', $e); $adapter->setUserUnconnected(); } $this->returnToCallbackUrl($providerId); }
/** * Returns the adapter instance for an authenticated provider. * * @param string $providerId * * @return R2\Auth\Adapter\AdapterInterface */ public function getAdapter($providerId) { $adapterFactory = new AdapterFactory($this->config, $this->storage); return $adapterFactory->setup($providerId); }