mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-06-26 06:34:56 +02:00
Fix login and register redirects in Frontend BETA
This commit is contained in:
parent
11b188d146
commit
1a24a9e11d
|
@ -12,7 +12,6 @@ import drawSine from "../../util/loginSineRenderer";
|
|||
import {fetchLogin} from "../../service/authenticationService";
|
||||
import ForgotPasswordModal from "../../components/modal/ForgotPasswordModal";
|
||||
import {useAuth} from "../../hooks/authenticationHook";
|
||||
import {baseAddress} from "../../service/backendConfiguration";
|
||||
|
||||
const Logo = () => {
|
||||
return (
|
||||
|
@ -170,9 +169,9 @@ const LoginPage = () => {
|
|||
} else if (data && data.success) {
|
||||
await updateLoginDetails();
|
||||
if (redirectTo && !redirectTo.startsWith('http') && !redirectTo.startsWith('file') && !redirectTo.startsWith('javascript')) {
|
||||
navigate(baseAddress + redirectTo.substring(redirectTo.indexOf('/')) + (window.location.hash ? window.location.hash : ''));
|
||||
navigate(redirectTo.substring(redirectTo.indexOf('/')) + (window.location.hash ? window.location.hash : ''));
|
||||
} else {
|
||||
navigate(baseAddress + '/');
|
||||
navigate('/');
|
||||
}
|
||||
} else {
|
||||
setFailMessage(t('html.login.failed') + data ? data.error : t('generic.noData'));
|
||||
|
|
|
@ -11,7 +11,6 @@ import ColorSelectorModal from "../../components/modal/ColorSelectorModal";
|
|||
import {useAuth} from "../../hooks/authenticationHook";
|
||||
import FinalizeRegistrationModal from "../../components/modal/FinalizeRegistrationModal";
|
||||
import {fetchRegisterCheck, postRegister} from "../../service/authenticationService";
|
||||
import {baseAddress} from "../../service/backendConfiguration";
|
||||
|
||||
const Logo = () => {
|
||||
return (
|
||||
|
@ -132,7 +131,7 @@ const RegisterPage = () => {
|
|||
if (error) {
|
||||
setFailMessage(t('html.register.error.checkFailed') + error)
|
||||
} else if (data && data.success) {
|
||||
navigate(baseAddress + '/login?registerSuccess=true');
|
||||
navigate('/login?registerSuccess=true');
|
||||
} else {
|
||||
setTimeout(() => checkRegistration(code), 5000);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user