Skip to content

Commit

Permalink
Ikke logg inn i dekoratøren lokalt og i mock
Browse files Browse the repository at this point in the history
  • Loading branch information
almyy committed Nov 29, 2024
1 parent 0e99605 commit a3b2176
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib/hooks/auth/useDecoratorLogin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ const loginUrl = digisosConfig.dekoratorLoginBaseUrl + "/oauth2/login";
const useDecoratorLogin = () => {
const router = useRouter();
const [isLoading, setIsLoading] = useState(false);
const isEnabled = ["prod", "preprod"].includes(process.env.NEXT_PUBLIC_DIGISOS_ENV!);
useEffect(() => {
if (!isEnabled) {
return;
}
setIsLoading(true);
try {
fetch(sessionUrl, {
Expand All @@ -37,7 +41,7 @@ const useDecoratorLogin = () => {
logger.error(e);
}
setIsLoading(false);
}, []);
}, [isEnabled]);
return isLoading;
};

Expand Down

0 comments on commit a3b2176

Please sign in to comment.