Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit e42bda3

Browse files
committed
fix redirect to filehandler
1 parent aeb0881 commit e42bda3

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/components/basicElements/login/Login.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ function Login(): ReactElement {
5151
if (tokens.refreshToken && tokens.accessToken?.token) {
5252
if (dest) {
5353
history.push(decodeURIComponent(dest));
54+
window.location.reload(); // reload because we are leaving the spa
5455
} else {
5556
history.push("/");
5657
}

src/components/pages/errors/Error400.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,20 @@ export default function Error400({ needsLogin }: Props) {
1212
const dest = urlSearchParams.get("dest");
1313
const message = urlSearchParams.get("message");
1414

15-
const tryAgainUrl = needsLogin
16-
? "/login?dest=" + dest
17-
: decodeURIComponent(dest ?? "");
18-
console.log(location);
15+
const tryAgainUrl = needsLogin ? (
16+
<Link to={"/login?dest=" + dest}>Try again</Link>
17+
) : (
18+
<a href={decodeURIComponent(dest ?? "")}> Try again </a> // a tag because we are leaving the spa
19+
);
1920

2021
return (
2122
<Container className={"text-center"}>
2223
<h2>Something went wrong!</h2>
2324
<h3>The file could not be loaded</h3>
2425
{message && <h4>{message}</h4>}
25-
{tryAgainUrl && (
26-
<p>
27-
<Link to={tryAgainUrl}>Try again</Link>
28-
</p>
29-
)}
26+
{tryAgainUrl && <p></p>}
3027
<Link to="/">Go to Home</Link>
28+
{tryAgainUrl}
3129
</Container>
3230
);
3331
}

0 commit comments

Comments
 (0)