everyone. I'm having a problem viewing a page from Heroku. The following: I have an application where a user has to register (email, password). An email will then be sent from Spring Boot to his email address with a verification link in it. If the user clicks on this, he will be redirected to a confirmation page (also in heroku). So far so good. The problem now is that I don't see anything on the confirmation page. I get the following error in the debugger:
main.f0ce501a.js:1 Uncaught SyntaxError: Unexpected token '<' (at main.f0ce501a.js:1:1) manifest.json:1 Manifest: Line: 1, column: 1, syntax error.
The URL on which the redirect takes place looks like this:
https://xxxxxx.herokuapp.com/registrierung/631868ce8aa8d25f58f07668.
However, I am trying to redirect to a URL like this:
so I don't get any problem at all and the page loads without a problem. I think it has something to do with the UserID in the URL, but I have no idea why
My App.js for forwarding:
<Route path="/registrierung/:id" element={<Registrierung />} />
This is what my React component looks like, in which I need the UserId from the URL
export default function Registrierung() {
const navigate = useNavigate();
const path = useLocation().pathname.split("/")[2];
useEffect(() => {
const registrierungAbgschlossen = async () => {
await axiosInstance
.put(`/benutzer/update/${path}`, {
emailBestaetig: true,
emailBestaetigtAm: new Date(),
})
.then((res) => {
console.log(res.data);
setTimeout(() => {
navigate("/Login");
}, 3000);
});
};
registrierungAbgschlossen();
}, [path]);
return (
<Box sx={{ p: 1, mt: 5 }}>
<Typography variant="h6" align="center">
Vielen Dank für Ihre Registrierung. Sie werden nach 3 Sekunden
automatisch weitergeleitet
</Typography>
</Box>
);
}
And this is the URL from inside Spring Boot
String url = "https://xxxxxx.herokuapp.com/registrierung/"+userId;
