uriFactory->createUri($pds); } // throw if the host is empty if($pds->getHost() === ''){ throw new OAuthException('invalid PDS URL'); } // enforce https and remove unnecessary parts $pds = $pds->withScheme('https')->withQuery('')->withFragment(''); // set the provider URLs $this->authorizationURL = (string)$pds->withPath('/oauth/authorize'); $this->accessTokenURL = (string)$pds->withPath('/oauth/token'); $this->apiURL = (string)$pds->withPath('/xrpc'); $this->parAuthorizationURL = (string)$pds->withPath('/oauth/par'); return $this; } } ?>