Cleanup singOutUrl

This commit is contained in:
Luka Radenovic 2022-07-13 14:35:45 +02:00
parent 45a9033299
commit 3f455aedd9

View file

@ -48,14 +48,13 @@ const Header: React.FC<HeaderProps> = () => {
const navigationItems = filterNavigationByDashboardRole(isAdmin);
// eslint-disable-next-line react-hooks/exhaustive-deps
const signOutUrl = useMemo(() => {
const { hostname } = window.location;
// If we are developing locally, we need to use the init cluster's public URL
if (hostname === 'localhost') {
return `https://sso.init.stackspin.net/oauth2/sessions/logout`;
}
return `https://sso.${hostname.replace('dashboard', '')}/oauth2/sessions/logout`;
return `https://${hostname.replace('dashboard', 'sso')}/oauth2/sessions/logout`;
}, []);
return (