mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-25 03:49:11 +00:00
fix(web): simplify callbackHost builder
This commit is contained in:
parent
8431df784f
commit
0a399938d6
1 changed files with 2 additions and 2 deletions
|
@ -11,10 +11,10 @@ const Login = () => {
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
const url = new URL(window.location.href);
|
const url = new URL(window.location.href);
|
||||||
const callbackHost = `${url.protocol}://${url.host}`;
|
const callbackHost = new URL('/', url);
|
||||||
const redirectServerID = url.searchParams.get('r');
|
const redirectServerID = url.searchParams.get('r');
|
||||||
if (!redirectServerID) {
|
if (!redirectServerID) {
|
||||||
window.location.href = `${apiUrl}/login-bounce?cbh=${callbackHost}`;
|
window.location.href = `${apiUrl}/login-bounce?cbh=${callbackHost.href}`;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue