fix: useOAuthClient is not initialized (#17637)

This commit is contained in:
Lauris Skraucis
2024-11-14 15:35:45 +00:00
committed by GitHub
parent 3589767099
commit 538a39328e
@@ -26,11 +26,11 @@ export const useOAuthClient = ({
const prevClientId = usePrevious(clientId);
const [isInit, setIsInit] = useState<boolean>(false);
useEffect(() => {
if (apiUrl && http.getUrl() !== apiUrl) {
if (apiUrl) {
http.setUrl(apiUrl);
setIsInit(true);
}
if (refreshUrl && http.getRefreshUrl() !== refreshUrl) {
if (refreshUrl) {
http.setRefreshUrl(refreshUrl);
}
}, [apiUrl, refreshUrl]);