fix(web): simplify callbackHost builder

This commit is contained in:
41666 2021-03-13 16:28:01 -05:00
parent 8431df784f
commit 0a399938d6

View file

@ -11,10 +11,10 @@ const Login = () => {
React.useEffect(() => {
const url = new URL(window.location.href);
const callbackHost = `${url.protocol}://${url.host}`;
const callbackHost = new URL('/', url);
const redirectServerID = url.searchParams.get('r');
if (!redirectServerID) {
window.location.href = `${apiUrl}/login-bounce?cbh=${callbackHost}`;
window.location.href = `${apiUrl}/login-bounce?cbh=${callbackHost.href}`;
return;
}