diff --git a/public/app/core/components/AppChrome/TopBar/SignInLink.tsx b/public/app/core/components/AppChrome/TopBar/SignInLink.tsx index 8b7650fd738..19791612093 100644 --- a/public/app/core/components/AppChrome/TopBar/SignInLink.tsx +++ b/public/app/core/components/AppChrome/TopBar/SignInLink.tsx @@ -8,7 +8,12 @@ import { useStyles2 } from '@grafana/ui'; export function SignInLink() { const location = useLocation(); const styles = useStyles2(getStyles); - const loginUrl = textUtil.sanitizeUrl(locationUtil.getUrlForPartial(location, { forceLogin: 'true' })); + let loginUrl = textUtil.sanitizeUrl(locationUtil.getUrlForPartial(location, { forceLogin: 'true' })); + + // Fix for loginUrl starting with "//" which is a scheme relative URL + if (loginUrl.startsWith('//')) { + loginUrl = loginUrl.replace(/\/+/g, '/'); + } return (